-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
2 changed files
with
6 additions
and
65 deletions.
There are no files selected for viewing
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
36 changes: 6 additions & 30 deletions
36
src/Shiny.Mediator.Uno/Infrastructure/AlertDialogService.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,38 +1,14 @@ | ||
using Microsoft.UI.Xaml; | ||
using Uno.Extensions.Hosting; | ||
using Uno.Extensions.Navigation; | ||
using Windows.UI.Popups; | ||
|
||
namespace Shiny.Mediator.Infrastructure; | ||
|
||
|
||
public class AlertDialogService(IRouteNotifier routeNotifier) : IAlertDialogService, IServiceInitialize | ||
public class AlertDialogService : IAlertDialogService | ||
{ | ||
public void Initialize() | ||
public async void Display(string title, string message) | ||
{ | ||
routeNotifier.RouteChanged += (sender, args) => | ||
{ | ||
var view = args.Region.View; | ||
Console.WriteLine("View: " + view?.GetType().FullName); | ||
Console.WriteLine("DC: " + args.Region.View?.DataContext?.GetType().FullName); | ||
}; | ||
} | ||
|
||
public void Display(string title, string message) | ||
{ | ||
// new Navigator(null, null, ) | ||
// Window.Current.CoreWindow | ||
// try | ||
// { | ||
// await navigator.ShowMessageDialogAsync( | ||
// this, | ||
// title: title, | ||
// content: message | ||
// ); | ||
// | ||
// } | ||
// catch (Exception ex) | ||
// { | ||
// Console.WriteLine(ex); | ||
// } | ||
var dialog = new MessageDialog(message, title); | ||
dialog.Commands.Add(new UICommand("OK")); | ||
await dialog.ShowAsync(); | ||
} | ||
} |