diff --git a/ModernKeePass/App.xaml.cs b/ModernKeePass/App.xaml.cs index 3031ae4..306d75c 100644 --- a/ModernKeePass/App.xaml.cs +++ b/ModernKeePass/App.xaml.cs @@ -9,6 +9,7 @@ using Windows.UI.Xaml.Navigation; using ModernKeePass.Common; using ModernKeePass.Exceptions; using ModernKeePass.Services; +using ModernKeePass.Views; // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 @@ -103,7 +104,7 @@ namespace ModernKeePass // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter - rootFrame.Navigate(typeof(Pages.MainPage), lauchActivatedEventArgs.Arguments); + rootFrame.Navigate(typeof(MainPage), lauchActivatedEventArgs.Arguments); } /*else { @@ -158,7 +159,7 @@ namespace ModernKeePass base.OnFileActivated(args); var rootFrame = new Frame(); Database.DatabaseFile = args.Files[0] as StorageFile; - rootFrame.Navigate(typeof(Pages.MainPage), args); + rootFrame.Navigate(typeof(MainPage), args); Window.Current.Content = rootFrame; Window.Current.Activate(); } diff --git a/ModernKeePass/Common/MessageDialogHelper.cs b/ModernKeePass/Common/MessageDialogHelper.cs index 657d497..d90b41f 100644 --- a/ModernKeePass/Common/MessageDialogHelper.cs +++ b/ModernKeePass/Common/MessageDialogHelper.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Windows.Storage.Pickers; using Windows.UI.Popups; +using Windows.UI.Xaml.Media.Animation; using ModernKeePass.Exceptions; using ModernKeePass.Interfaces; @@ -12,18 +13,11 @@ namespace ModernKeePass.Common public static async void ShowActionDialog(string title, string contentText, string actionButtonText, string cancelButtonText, UICommandInvokedHandler action) { // Create the message dialog and set its content - var messageDialog = new MessageDialog(contentText, title); + var messageDialog = CreateBasicDialog(title, contentText, cancelButtonText); // Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers messageDialog.Commands.Add(new UICommand(actionButtonText, action)); - messageDialog.Commands.Add(new UICommand(cancelButtonText)); - - // Set the command that will be invoked by default - messageDialog.DefaultCommandIndex = 1; - - // Set the command to be invoked when escape is pressed - messageDialog.CancelCommandIndex = 1; - + // Show the message dialog await messageDialog.ShowAsync(); } @@ -48,13 +42,35 @@ namespace ModernKeePass.Common { if (exception == null) return; // Create the message dialog and set its content - var messageDialog = new MessageDialog(exception.Message, "Error occured"); - - // Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers - messageDialog.Commands.Add(new UICommand("OK")); + var messageDialog = CreateBasicDialog("Error occured", exception.Message, "OK"); // Show the message dialog await messageDialog.ShowAsync(); } + + public static async void ShowNotificationDialog(string title, string message) + { + var dialog = CreateBasicDialog(title, message, "OK"); + + // Show the message dialog + await dialog.ShowAsync(); + } + + private static MessageDialog CreateBasicDialog(string title, string message, string dismissActionText) + { + // Create the message dialog and set its content + var messageDialog = new MessageDialog(message, title); + + // Add commands and set their callbacks; + messageDialog.Commands.Add(new UICommand(dismissActionText)); + + // Set the command that will be invoked by default + messageDialog.DefaultCommandIndex = 1; + + // Set the command to be invoked when escape is pressed + messageDialog.CancelCommandIndex = 1; + + return messageDialog; + } } } diff --git a/ModernKeePass/Interfaces/ILicenseService.cs b/ModernKeePass/Interfaces/ILicenseService.cs index 94e4895..b1835ab 100644 --- a/ModernKeePass/Interfaces/ILicenseService.cs +++ b/ModernKeePass/Interfaces/ILicenseService.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using Windows.ApplicationModel.Store; namespace ModernKeePass.Interfaces @@ -6,5 +7,6 @@ namespace ModernKeePass.Interfaces public interface ILicenseService { IReadOnlyDictionary Products { get; } + Task Purchase(string addOn); } } diff --git a/ModernKeePass/ModernKeePassApp.csproj b/ModernKeePass/ModernKeePassApp.csproj index 0ec278b..92c2e08 100644 --- a/ModernKeePass/ModernKeePassApp.csproj +++ b/ModernKeePass/ModernKeePassApp.csproj @@ -117,7 +117,8 @@ - + + DonatePage.xaml @@ -141,22 +142,22 @@ - - + + SettingsDatabasePage.xaml - + SettingsNewDatabasePage.xaml - + SettingsSecurityPage.xaml - + SettingsWelcomePage.xaml - + CompositeKeyUserControl.xaml @@ -171,20 +172,20 @@ - + MainPage.xaml - + AboutPage.xaml - + NewDatabasePage.xaml - + SettingsPage.xaml - + WelcomePage.xaml @@ -192,19 +193,19 @@ - + EntryDetailPage.xaml - + GroupDetailPage.xaml - + OpenDatabasePage.xaml - + RecentDatabasesPage.xaml - + SaveDatabasePage.xaml @@ -239,67 +240,67 @@ MSBuild:Compile Designer - + Designer MSBuild:Compile - + MSBuild:Compile Designer - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile diff --git a/ModernKeePass/Pages/MainPageFrames/DonatePage.xaml b/ModernKeePass/Pages/MainPageFrames/DonatePage.xaml deleted file mode 100644 index 1c7d09e..0000000 --- a/ModernKeePass/Pages/MainPageFrames/DonatePage.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - -