-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathFluentToastInverted.razor
More file actions
35 lines (31 loc) · 1.04 KB
/
FluentToastInverted.razor
File metadata and controls
35 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@inject IToastService ToastService
<FluentButton OnClick="@OpenToastAsync">
Make toast
</FluentButton>
@code {
int clickCount = 0;
private async Task OpenToastAsync()
{
var result = await ToastService.ShowToastAsync(options =>
{
options.Intent = ToastIntent.Info;
options.Title = $"Toast title {++clickCount}";
options.Body = "Toasts are used to show brief messages to the user.";
options.Subtitle = "subtitle";
options.QuickAction1 = "Action";
options.QuickAction1Callback = () =>
{
Console.WriteLine("Action 1 executed.");
return Task.CompletedTask;
};
options.IsDismissable = true;
options.DismissAction = "Close";
options.OnStatusChange = (e) =>
{
Console.WriteLine($"Status changed: {e.Id} - {e.Status}");
};
options.Inverted = true;
});
Console.WriteLine($"Toast result: {result}");
}
}