Back to Devexpress

DxToast.Close() Method

blazor-devexpress-dot-blazor-dot-dxtoast-4f3b37c9.md

latest1.4 KB
Original Source

DxToast.Close() Method

Closes the toast notification.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public void Close()

Remarks

Call the Close method to close the toast notification.

A toast notification automatically disappears after its display time is over (DisplayTime). If the display time is set to zero, the toast stays visible until it is forced closed.

Run Demo: Toast Template

razor
<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Show toast notification" Click="ShowToast" />
<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Close toast notification" Click="CloseToast" />
<DxToastProvider />

<DxToast @ref=toast
          DisplayTime="@TimeSpan.Zero"
          Title="Notification"
          Text="The process is completed." />
@code {
    DxToast toast;
    private void ShowToast() {
        toast.Show();
    }
    private void CloseToast() {
        toast.Close();
    }
}

See Also

DxToast Class

DxToast Members

DevExpress.Blazor Namespace