blazor-devexpress-dot-blazor-dot-dxtoastprovider-6d0b991d.md
Specifies whether toasts display the Close button.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(true)]
[Parameter]
public bool ShowCloseButton { get; set; }
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true to display the Close button; otherwise, false.
|
Set the ShowCloseButton to false to hide the Close button from toast notifications. This value can be overwritten at a toast level by the DxToast.ShowCloseButton or ToastOptions.ShowCloseButton property.
<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Show a toast" Click="AddToast" />
<DxToastProvider ShowIcon="false" ShowCloseButton="false" ThemeMode=ToastThemeMode.Pastel/>
@code {
[Inject] IToastNotificationService ToastService { get; set; }
private void AddToast() {
ToastService.ShowToast(new ToastOptions {
Title = "Notification",
Text = "The process is completed.",
CssClass = "italic-text"
});
}
}
.italic-text {
font-style: italic;
text-align: center;
}
See Also