DxToastProvider.ShowCloseButton Property
Specifies whether toasts display the Close button.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(true)]
[Parameter]
public bool ShowCloseButton { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
Remarks
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.
<style>
.italic-text {
font-style: italic;
text-align: center;
}
</style>
<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"
});
}
}
See Also