-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
11 additions
and
113 deletions.
There are no files selected for viewing
14 changes: 10 additions & 4 deletions
14
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Services/MessageBoxService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
namespace Bit.BlazorUI.Demo.Client.Core.Services; | ||
|
||
public partial class MessageBoxService | ||
{ | ||
[AutoInject] private IPubSubService pubSubService = default!; | ||
[AutoInject] private BitModalService modalService { get; set; } = default!; | ||
|
||
public async Task Show(string message, string title = "") | ||
{ | ||
TaskCompletionSource<object?> tcs = new(); | ||
pubSubService.Publish(PubSubMessages.SHOW_MESSAGE, (message, title, tcs)); | ||
await tcs.Task; | ||
BitModalReference modalRef = default!; | ||
Dictionary<string, object> parameters = new() | ||
{ | ||
{ nameof(BitMessageBox.Title), title }, | ||
{ nameof(BitMessageBox.Body), message }, | ||
{ nameof(BitMessageBox.OnClose), EventCallback.Factory.Create(this, () => modalRef.Close()) } | ||
}; | ||
modalRef = await modalService.Show<BitMessageBox>(parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ | |
</BitLayout> | ||
</BitAppShell> | ||
|
||
<MessageBox /> | ||
<BitModalContainer /> |
18 changes: 0 additions & 18 deletions
18
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MessageBox.razor
This file was deleted.
Oops, something went wrong.
60 changes: 0 additions & 60 deletions
60
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MessageBox.razor.cs
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MessageBox.razor.scss
This file was deleted.
Oops, something went wrong.