Back to Devexpress

DxToastProvider.ShowCloseButton Property

blazor-devexpress-dot-blazor-dot-dxtoastprovider-6d0b991d.md

latest1.9 KB
Original Source

DxToastProvider.ShowCloseButton Property

Specifies whether toasts display the Close button.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(true)]
[Parameter]
public bool ShowCloseButton { get; set; }

Property Value

TypeDefaultDescription
Booleantrue

true to display the Close button; otherwise, false.

|

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.

razor
<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"
        });
    }
}
css
.italic-text {
    font-style: italic;
    text-align: center;
}

See Also

DxToastProvider Class

DxToastProvider Members

DevExpress.Blazor Namespace