Class SfToastNotification
Control that provides the toast popup and related static helpers to show and close toasts. Adding this control to a host's XAML ensures the theme and overlay ControlTemplate from Generic.xaml are available.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.SfToastNotification
Assembly: Syncfusion.SfToastNotification.WPF.dll
Syntax
public class SfToastNotification : Control, IDisposable
Constructors
SfToastNotification()
Initializes a new instance of the SfToastNotification control. Creating this control in XAML ensures the overlay template and themes are loaded for toast rendering.
Declaration
public SfToastNotification()
Properties
MaxToastVisibleCount
Defines the maximum number of toast notifications that can be displayed simultaneously. Remaining toasts will be queued.
Declaration
public static int MaxToastVisibleCount { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Methods
Close(String)
Closes the toast with the specified identifier.
Returns true when a toast was found and closed; otherwise false.
Declaration
public static bool Close(string toastId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | toastId | The identifier of the toast to close. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the toast was closed; otherwise false. |
CloseAll()
Closes all currently showing toasts across the application.
Declaration
public static void CloseAll()
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Show(DependencyObject, ToastOptions)
Shows a toast using the provided ToastOptions on the specified host.
Declaration
public static void Show(DependencyObject host, ToastOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | host | The host System.Windows.DependencyObject used to locate the visual tree. |
| ToastOptions | options | Options describing the toast content and behavior. |