Class ToastItem
Represents a toast instance used by hosts to render a notification. This model is created from ToastOptions and exposes read-only properties used by the control template.
Inheritance
Namespace: Syncfusion.UI.Xaml.SfToastNotification
Assembly: Syncfusion.SfToastNotification.WPF.dll
Syntax
public class ToastItem : ContentControl
Fields
AccentBrushProperty
Declaration
public static readonly DependencyProperty AccentBrushProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ActionTemplateSelectorProperty
Identifies the ActionTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty ActionTemplateSelectorProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CloseButtonTemplateProperty
Identifies the CloseButtonTemplate dependency property.
Declaration
public static readonly DependencyProperty CloseButtonTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SeverityProperty
Identifies the Severity dependency property.
Declaration
public static readonly DependencyProperty SeverityProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
TitleTemplateProperty
Identifies the TitleTemplate dependency property.
Declaration
public static readonly DependencyProperty TitleTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
VariantProperty
Identifies the Variant dependency property.
Declaration
public static readonly DependencyProperty VariantProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
AccentBrush
Gets or sets the accent brush used to tint visual elements for this toast (icons, borders, and 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
Gets the collection of actions rendered for this toast.
Declaration
public IReadOnlyList<ToastAction> Actions { get; }
Property Value
| Type |
|---|
| System.Collections.Generic.IReadOnlyList<ToastAction> |
ActionTemplateSelector
Gets or sets the System.Windows.Controls.DataTemplateSelector used to choose templates for action buttons. Allows per-action template selection. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplateSelector ActionTemplateSelector { get; set; }
Property Value
| Type |
|---|
| System.Windows.Controls.DataTemplateSelector |
CloseButtonTemplate
Gets or sets the template used to render the close button. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplate CloseButtonTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
Header
Gets the header text shown above or beside the message. Applies to in-app toasts only; not used for native toasts.
Declaration
public string Header { get; }
Property Value
| Type |
|---|
| System.String |
Message
Gets the main message body of the toast.
Declaration
public string Message { get; }
Property Value
| Type |
|---|
| System.String |
Mode
Gets the display mode used for this toast.
Declaration
public ToastMode Mode { get; }
Property Value
| Type |
|---|
| ToastMode |
Severity
Gets or sets the severity for the toast. Applies to in-app toasts only; not used for native toasts. Use the matching SeverityProperty for binding.
Declaration
public ToastSeverity Severity { get; set; }
Property Value
| Type |
|---|
| ToastSeverity |
ShowActionButtons
Gets a value indicating whether the action buttons row should be displayed. Applies to in-app toasts only; not used for native toasts.
Declaration
public bool ShowActionButtons { get; }
Property Value
| Type |
|---|
| System.Boolean |
ShowCloseButton
Gets a value indicating whether the close button should be displayed. Applies to in-app toasts only; not used for native toasts.
Declaration
public bool ShowCloseButton { get; }
Property Value
| Type |
|---|
| System.Boolean |
Title
Gets the title text for the toast.
Declaration
public string Title { get; }
Property Value
| Type |
|---|
| System.String |
TitleTemplate
Gets or sets the template used to render the title area of the toast. Applies to in-app toasts only; not used for native toasts.
Declaration
public DataTemplate TitleTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
Variant
Gets or sets the visual variant of the toast (Text, Outlined, Filled). Applies to in-app toasts only; not used for native toasts. Use the matching VariantProperty for binding.
Declaration
public ToastVariant Variant { get; set; }
Property Value
| Type |
|---|
| ToastVariant |