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
Namespace: Syncfusion.UI.Xaml.SfToastNotification
Assembly: Syncfusion.SfToastNotification.WPF.dll
Syntax
public class SfToastNotification : Control
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()
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()
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. |