blazor-devexpress-dot-blazor-8769e5c9.md
Defines options for a toast notification.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public class ToastOptions
The ToastOptions object allows you to set up toast settings when you create a toast notification at runtime.
<DxButton Text="Show a toast" Click="CreateToastAtRuntime" />
<DxToastProvider />
@code {
[Inject] IToastNotificationService ToastService { get; set; }
private void CreateToastAtRuntime() {
ToastService.ShowToast(new ToastOptions {
Title = "Notification",
Text = "The process is completed.",
ShowIcon = false,
CssClass = "italic-text",
ThemeMode = ToastThemeMode.Pastel,
ShowCloseButton = false,
});
}
}
.italic-text {
font-style: italic;
text-align: center;
}
ToastOptions does not set the toast position. To position toast notifications on the page at runtime, use one of the following approaches:
Object ToastOptions
See Also