diff --git a/exclusion.dic b/exclusion.dic index 3186ef2244d..34a15eb8ae0 100644 --- a/exclusion.dic +++ b/exclusion.dic @@ -121,3 +121,5 @@ dotx Modbus Protocol vditor +alertdialog +blazorbootstrap diff --git a/src/BootstrapBlazor.Server/Components/Samples/Messages.razor b/src/BootstrapBlazor.Server/Components/Samples/Messages.razor index 08226ed497a..a59eb727112 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Messages.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Messages.razor @@ -1,4 +1,4 @@ -@page "/message" +@page "/message" @inject IStringLocalizer Localizer @inject MessageService MessageService @@ -20,8 +20,18 @@ private MessageService? MessageService { get; set; } }); - - +
+
+ + + + +
+
+ +
+
+
@@ -70,7 +80,6 @@ private MessageService? MessageService { get; set; } - diff --git a/src/BootstrapBlazor.Server/Components/Samples/Messages.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Messages.razor.cs index 4821c6f7a4e..83936905a9f 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Messages.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Messages.razor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone @@ -18,13 +18,20 @@ public sealed partial class Messages private readonly MessageOption _option = new(); + private long _count = 0; + + private string _placement = "Top"; + + private readonly List _items = [new SelectedItem("Top", "Top"), new SelectedItem("Bottom", "Bottom")]; + + private Placement Placement => _placement == "Top" ? Placement.Top : Placement.Bottom; + private async Task ShowMessage() { - Message.SetPlacement(Placement.Top); await MessageService.Show(new MessageOption() { - Content = "This is a reminder message" - }); + Content = $"This is a reminder message {_count++}" + }, Message); } private async Task ShowAsyncMessage() @@ -97,7 +104,7 @@ private async Task ShowBottomMessage() { await MessageService.Show(new MessageOption() { - Content = $"This is a reminder message - {DateTime.Now:mm:ss}", + Content = $"This is a reminder message - {_count++}", Icon = "fa-solid fa-circle-info", }, Message1); } @@ -111,13 +118,11 @@ await MessageService.Show(new MessageOption() }); } - private int lastCount = 0; - private Task ShowLastOnlyMessage() => MessageService.Show(new MessageOption() { ShowShadow = true, ShowMode = MessageShowMode.Single, - Content = lastCount++.ToString() + Content = $"This is a reminder message - {_count++}" }); private static AttributeItem[] GetAttributes() => diff --git a/src/BootstrapBlazor/Components/Message/Message.razor b/src/BootstrapBlazor/Components/Message/Message.razor index 98f64631cb2..fcdb43ec9e3 100644 --- a/src/BootstrapBlazor/Components/Message/Message.razor +++ b/src/BootstrapBlazor/Components/Message/Message.razor @@ -1,59 +1,29 @@ -@namespace BootstrapBlazor.Components +@namespace BootstrapBlazor.Components @inherits BootstrapModuleComponentBase @attribute [BootstrapModuleAutoLoader(JSObjectReference = true)]