Back to Devexpress

DxToastProvider.ShowIcon Property

blazor-devexpress-dot-blazor-dot-dxtoastprovider-235b2518.md

latest1.9 KB
Original Source

DxToastProvider.ShowIcon Property

Specifies whether to show an icon in toast notifications.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
Booleantrue

true to show the icon; otherwise, false.

|

Remarks

A toast notification displays a predefined icon. Set the ShowIcon property to false to hide the icon. Use a toast’s DxToast.IconCssClass or ToastOptions.IconCssClass property to customize icon settings or display a custom icon.

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