From 26b256c82ab4ae04c8d1debb819f5685c794c594 Mon Sep 17 00:00:00 2001 From: Peace Date: Fri, 26 Jul 2024 16:46:50 +0900 Subject: [PATCH] toast 1 --- .../Components/Layout/NavMenu.razor | 1 + .../Pages/Components/CompoOverlay.razor | 4 +-- .../Pages/Components/CompoToast.razor | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 BlazorFluentUI/Components/Pages/Components/CompoToast.razor diff --git a/BlazorFluentUI/Components/Layout/NavMenu.razor b/BlazorFluentUI/Components/Layout/NavMenu.razor index 751d7c1..ce91d95 100644 --- a/BlazorFluentUI/Components/Layout/NavMenu.razor +++ b/BlazorFluentUI/Components/Layout/NavMenu.razor @@ -70,6 +70,7 @@ MessageBar MessageBox Overlay + Toast diff --git a/BlazorFluentUI/Components/Pages/Components/CompoOverlay.razor b/BlazorFluentUI/Components/Pages/Components/CompoOverlay.razor index 1cd4aa2..959c780 100644 --- a/BlazorFluentUI/Components/Pages/Components/CompoOverlay.razor +++ b/BlazorFluentUI/Components/Pages/Components/CompoOverlay.razor @@ -1,10 +1,8 @@ @page "/compooverlay" -@inject IDialogService DialogService; - @rendermode RenderMode.InteractiveServer -

MessageBox

+

Overlay

FluentOverlays are used to templorarily overlay screen content to focus a dialog, progress or other infomtion/interaction. diff --git a/BlazorFluentUI/Components/Pages/Components/CompoToast.razor b/BlazorFluentUI/Components/Pages/Components/CompoToast.razor new file mode 100644 index 0000000..8fb307b --- /dev/null +++ b/BlazorFluentUI/Components/Pages/Components/CompoToast.razor @@ -0,0 +1,30 @@ +@page "/compotoast" + +@inject IToastService ToastService + +@rendermode RenderMode.InteractiveServer + +

Toast

+ +
+ FluentToasts, referred to as "notifications" in the UI, are pop-up notifications that keep users informed by briefly. +
+ + +

Default

+ +

+ Click ont this button to open a Toast. +

+ Open +
+ +@code { + int dcounter = 1; + void ShowDToast() + { + var intent = Enum.GetValues()[Random.Shared.Next(10)]; + var message = $"Simple Toast #{dcounter++}"; + ToastService.ShowToast(intent, message); + } +}