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 |
CreationTime
Time at which the toast is shown. Defaults to System.DateTime.Now, used to display the toast shown time in grouped notifications.
Declaration
public DateTime CreationTime { get; set; }
Property Value
| Type |
|---|
| System.DateTime |
Duration
Time to auto-close. Set PreventAutoClose to true to disable.
Declaration
public TimeSpan Duration { get; set; }
Property Value
| Type |
|---|
| System.TimeSpan |
GroupName
Specifies the group name used to organize related in-app toast notifications. Toasts with the same group name are displayed together in a screen-level container (Window and Screen modes)
Declaration
public string GroupName { get; set; }
Property Value
| Type |
|---|
| System.String |
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 |
HorizontalOffset
Horizontal offset for custom toast positioning. Positive values move the toast to the right, negative values move it to the left.
Declaration
public double HorizontalOffset { 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 |
VerticalOffset
Vertical offset for custom toast positioning. Positive values move the toast downward, negative values move it upward.
Declaration
public double VerticalOffset { get; set; }
Property Value
| Type |
|---|
| System.Double |
Width
Desired width for the toast container (pixels).
Declaration
public double Width { get; set; }
Property Value
| Type |
|---|
| System.Double |
X
Custom X coordinate for absolute positioning on the screen/window. Used when Placement is set to Custom.
Declaration
public double X { get; set; }
Property Value
| Type |
|---|
| System.Double |
Y
Custom Y coordinate for absolute positioning on the screen/window. Used when Placement is set to Custom.
Declaration
public double Y { get; set; }
Property Value
| Type |
|---|
| System.Double |