Class ToastOptions
Options describing how a toast should look and behave when shown.
Inheritance
Namespace: Syncfusion.UI.Xaml.SfToastNotification
Assembly: Syncfusion.SfToastNotification.WPF.dll
Syntax
public sealed class ToastOptions : Object
Constructors
ToastOptions()
Declaration
public ToastOptions()
Properties
AccentBrush
Brush used to tint accent elements of the toast (icons, borders, highlights). Not applied when Severity is None. Applies to in-app toasts only; not used for native toasts.
Declaration
public SolidColorBrush AccentBrush { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.SolidColorBrush |
Actions
Action buttons for the toast. For native toasts prefer using Arguments, for custom in-app toasts use Callback.
Declaration
public IList<ToastAction> Actions { get; set; }
Property Value
| Type |
|---|
| System.Collections.Generic.IList<ToastAction> |
ActionTemplateSelector
DataTemplateSelector for customizing action button appearance per action. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplateSelector ActionTemplateSelector { get; set; }
Property Value
| Type |
|---|
| System.Windows.Controls.DataTemplateSelector |
CloseAnimationType
Close animation type for this toast.
Declaration
public ToastAnimation CloseAnimationType { get; set; }
Property Value
| Type |
|---|
| ToastAnimation |
CloseButtonTemplate
DataTemplate that replaces the close button in the default template. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplate CloseButtonTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
ContentTemplate
DataTemplate that replaces only the content area (title/message) in the default template. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
Duration
Time to auto-close. Set PreventAutoClose to true to disable.
Declaration
public TimeSpan Duration { get; set; }
Property Value
| Type |
|---|
| System.TimeSpan |
Header
Header text shown above or beside the message. Applies to in-app toasts only; not used for native toasts.
Declaration
public string Header { get; set; }
Property Value
| Type |
|---|
| System.String |
Height
Desired height for the toast container (pixels).
Declaration
public double Height { get; set; }
Property Value
| Type |
|---|
| System.Double |
Id
Custom Id. Generated automatically if not supplied.
Declaration
public string Id { get; set; }
Property Value
| Type |
|---|
| System.String |
Message
Main message text.
Declaration
public string Message { get; set; }
Property Value
| Type |
|---|
| System.String |
Mode
Mode describing how the toast is displayed (native or in-app).
Declaration
public ToastMode Mode { get; set; }
Property Value
| Type |
|---|
| ToastMode |
Placement
Placement within the host.
Declaration
public ToastPlacement Placement { get; set; }
Property Value
| Type |
|---|
| ToastPlacement |
PreventAutoClose
Disables auto-close when true.
Declaration
public bool PreventAutoClose { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Severity
Severity of the in-app toast (Info/Success/Warning/Error).
Declaration
public ToastSeverity Severity { get; set; }
Property Value
| Type |
|---|
| ToastSeverity |
ShowActionButtons
Whether the action buttons row is visible for this toast. Applies to in-app toasts only; not used for native toasts.
Declaration
public bool ShowActionButtons { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowAnimationType
Show animation type for this toast.
Declaration
public ToastAnimation ShowAnimationType { get; set; }
Property Value
| Type |
|---|
| ToastAnimation |
ShowCloseButton
Whether the close button is visible for this toast. Applies to in-app toasts only; not used for native toasts.
Declaration
public bool ShowCloseButton { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Title
Title displayed in bold above the message.
Declaration
public string Title { get; set; }
Property Value
| Type |
|---|
| System.String |
TitleTemplate
DataTemplate that replaces only the title area in the default template. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplate TitleTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
ToastSound
Specifies the sound to be played for a toast notification.
Declaration
public ToastSound ToastSound { get; set; }
Property Value
| Type |
|---|
| ToastSound |
Remarks
This is applicable to both system and in-app toast notifications.
ToastSoundPath
Declaration
public Uri ToastSoundPath { get; set; }
Property Value
| Type |
|---|
| System.Uri |
Variant
Visual variant (filled, outline, etc.).
Declaration
public ToastVariant Variant { get; set; }
Property Value
| Type |
|---|
| ToastVariant |
Width
Desired width for the toast container (pixels).
Declaration
public double Width { get; set; }
Property Value
| Type |
|---|
| System.Double |