mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
feat: implemented Mediator and added dialog service
This commit is contained in:
1 parent
ec977c490a
commit
38c631bc44
13 files changed
+188
-54
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediatR;
|
||||
using Radzen;
|
||||
using WotBlitzStatisticsPro.Blazor.Messages;
|
||||
using WotBlitzStatisticsPro.Blazor.Model;
|
||||
using WotBlitzStatisticsPro.Blazor.Pages;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
{
|
||||
public class SearchDialogService: ISearchDialogService, INotificationHandler<OpenSearchDialogMessage>
|
||||
{
|
||||
|
||||
private readonly DialogService _dialogService;
|
||||
|
||||
public SearchDialogService(DialogService dialogService)
|
||||
{
|
||||
_dialogService = dialogService;
|
||||
}
|
||||
|
||||
|
||||
public async Task OpenSearchDialog(DialogType type)
|
||||
{
|
||||
await _dialogService.OpenAsync<SearchDialog>($"Search",
|
||||
new Dictionary<string, object>() { { "DialogType", type } },
|
||||
new DialogOptions() { Width = "300px", Height = "530px" });
|
||||
}
|
||||
|
||||
public Task Handle(OpenSearchDialogMessage notification, CancellationToken cancellationToken)
|
||||
{
|
||||
return OpenSearchDialog(notification.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user