-
Notifications
You must be signed in to change notification settings - Fork 467
Expand file tree
/
Copy pathDebugToastContent.razor
More file actions
34 lines (29 loc) · 932 Bytes
/
DebugToastContent.razor
File metadata and controls
34 lines (29 loc) · 932 Bytes
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
<div>
Toast Content
</div>
<div>
<FluentButton Appearance="ButtonAppearance.Primary"
OnClick="btnOK_Click">OK</FluentButton>
<FluentButton Appearance="ButtonAppearance.Default"
OnClick="btnCancel_Click">Cancel</FluentButton>
</div>
@code {
// If you want to use this razor component in standalone mode,
// you can use a nullable IToastInstance property.
// If the value is not null, the component is running using the ToastService.
// `public IToastInstance? FluentToast { get; set; }`
[CascadingParameter]
public required IToastInstance Toast { get; set; }
[Inject]
public required IToastService ToastService { get; set; }
[Parameter]
public string? Name { get; set; }
private async Task btnOK_Click()
{
await Toast.CloseAsync(ToastResult.Ok("Yes"));
}
private async Task btnCancel_Click()
{
await Toast.CloseAsync(ToastResult.Cancel("No"));
}
}