From 869502a72c6327b3dad8afb47666998e60baa553 Mon Sep 17 00:00:00 2001 From: "kwan.nguyen" Date: Tue, 7 Jan 2025 13:56:10 +0700 Subject: [PATCH] update app outdated dialog --- PCUT/PCUT/App.xaml.cs | 22 +++++----- PCUT/PCUT/PCUT.csproj | 7 ++++ PCUT/PCUT/Pages/AppOutdatedDialog.xaml | 50 +++++++++++++++++++++++ PCUT/PCUT/Pages/AppOutdatedDialog.xaml.cs | 39 ++++++++++++++++++ 4 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 PCUT/PCUT/Pages/AppOutdatedDialog.xaml create mode 100644 PCUT/PCUT/Pages/AppOutdatedDialog.xaml.cs diff --git a/PCUT/PCUT/App.xaml.cs b/PCUT/PCUT/App.xaml.cs index 4b74c99..eb8dbca 100644 --- a/PCUT/PCUT/App.xaml.cs +++ b/PCUT/PCUT/App.xaml.cs @@ -135,16 +135,18 @@ namespace PCUT if (e.Exception is AppOutdatedException outdatedException) { e.Handled = true; - var dialog = new MessageDialog(outdatedException.Message); - dialog.Commands.Add(new UICommand("Download", async (command) => - { - var _ = await Windows.System.Launcher.LaunchUriAsync( - new Uri("https://pcut.vn/download"), - new Windows.System.LauncherOptions { TreatAsUntrusted = false }); - })); - dialog.Commands.Add(new UICommand("Close")); - dialog.DefaultCommandIndex = 0; - dialog.CancelCommandIndex = 1; + //var dialog = new MessageDialog(outdatedException.Message); + //dialog.Commands.Add(new UICommand("Download", async (command) => + //{ + // var _ = await Windows.System.Launcher.LaunchUriAsync( + // new Uri("https://pcut.vn/download"), + // new Windows.System.LauncherOptions { TreatAsUntrusted = false }); + //})); + //dialog.Commands.Add(new UICommand("Close")); + //dialog.DefaultCommandIndex = 0; + //dialog.CancelCommandIndex = 1; + //await dialog.ShowAsync(); + var dialog = new AppOutdatedDialog(); await dialog.ShowAsync(); } } diff --git a/PCUT/PCUT/PCUT.csproj b/PCUT/PCUT/PCUT.csproj index fb351af..ca0e2db 100644 --- a/PCUT/PCUT/PCUT.csproj +++ b/PCUT/PCUT/PCUT.csproj @@ -183,6 +183,9 @@ + + AppOutdatedDialog.xaml + CategoryUpsertDialog.xaml @@ -351,6 +354,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/PCUT/PCUT/Pages/AppOutdatedDialog.xaml b/PCUT/PCUT/Pages/AppOutdatedDialog.xaml new file mode 100644 index 0000000..bcac727 --- /dev/null +++ b/PCUT/PCUT/Pages/AppOutdatedDialog.xaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + +