diff --git a/ModernKeePass/App.xaml b/ModernKeePass/App.xaml index aca89cf..069b3ad 100644 --- a/ModernKeePass/App.xaml +++ b/ModernKeePass/App.xaml @@ -10,6 +10,7 @@ + diff --git a/ModernKeePass/App.xaml.cs b/ModernKeePass/App.xaml.cs index 0236fc8..06f8fb8 100644 --- a/ModernKeePass/App.xaml.cs +++ b/ModernKeePass/App.xaml.cs @@ -11,6 +11,7 @@ using Windows.UI.Xaml.Navigation; using ModernKeePass.Common; using ModernKeePass.Exceptions; using ModernKeePass.Interfaces; +using ModernKeePass.Services; // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 @@ -21,7 +22,7 @@ namespace ModernKeePass /// sealed partial class App { - public DatabaseHelper Database { get; set; } = new DatabaseHelper(); + public DatabaseService Database { get; set; } = new DatabaseService(); /// /// Initializes the singleton application object. This is the first line of authored code @@ -48,7 +49,7 @@ namespace ModernKeePass if (!(realException is SaveException)) return; unhandledExceptionEventArgs.Handled = true; - MessageDialogHelper.SaveErrorDialog(realException as SaveException, Database); + MessageDialogService.SaveErrorDialog(realException as SaveException, Database); } /// diff --git a/ModernKeePass/ModernKeePassApp.csproj b/ModernKeePass/ModernKeePassApp.csproj index 1c0ce08..d04dbf4 100644 --- a/ModernKeePass/ModernKeePassApp.csproj +++ b/ModernKeePass/ModernKeePassApp.csproj @@ -113,14 +113,18 @@ App.xaml - - + + DonatePage.xaml + + + - + + @@ -244,6 +248,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -299,6 +307,11 @@ MSBuild:Compile PreserveNewest + + Designer + MSBuild:Compile + PreserveNewest + Designer MSBuild:Compile diff --git a/ModernKeePass/Pages/EntryDetailPage.xaml.cs b/ModernKeePass/Pages/EntryDetailPage.xaml.cs index ba3664e..0456c83 100644 --- a/ModernKeePass/Pages/EntryDetailPage.xaml.cs +++ b/ModernKeePass/Pages/EntryDetailPage.xaml.cs @@ -4,6 +4,7 @@ using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; using ModernKeePass.Common; +using ModernKeePass.Services; using ModernKeePass.ViewModels; // Pour en savoir plus sur le modèle d'élément Page Détail de l'élément, consultez la page http://go.microsoft.com/fwlink/?LinkId=234232 @@ -76,9 +77,9 @@ namespace ModernKeePass.Pages ? "Are you sure you want to send this entry to the recycle bin?" : "Are you sure you want to delete this entry?"; var text = isRecycleBinEnabled ? "Item moved to the Recycle bin" : "Item permanently removed"; - MessageDialogHelper.ShowActionDialog("Warning", message, "Delete", "Cancel", a => + MessageDialogService.ShowActionDialog("Warning", message, "Delete", "Cancel", a => { - ToastNotificationHelper.ShowMovedToast(Model, "Deleting", text); + ToastNotificationService.ShowMovedToast(Model, "Deleting", text); Model.MarkForDelete(); if (Frame.CanGoBack) Frame.GoBack(); }); @@ -86,7 +87,7 @@ namespace ModernKeePass.Pages private void RestoreButton_Click(object sender, RoutedEventArgs e) { - ToastNotificationHelper.ShowMovedToast(Model, "Restored", "Item returned to its original group"); + ToastNotificationService.ShowMovedToast(Model, "Restored", "Item returned to its original group"); if (Frame.CanGoBack) Frame.GoBack(); } @@ -99,7 +100,7 @@ namespace ModernKeePass.Pages } catch (Exception ex) { - MessageDialogHelper.ShowErrorDialog(ex); + MessageDialogService.ShowErrorDialog(ex); } } } diff --git a/ModernKeePass/Pages/GroupDetailPage.xaml b/ModernKeePass/Pages/GroupDetailPage.xaml index 0fdf633..512dfe1 100644 --- a/ModernKeePass/Pages/GroupDetailPage.xaml +++ b/ModernKeePass/Pages/GroupDetailPage.xaml @@ -106,7 +106,7 @@ DataContext="{Binding DataContext, ElementName=PageRoot}" RequestedTheme="Dark" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" - Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"> + Foreground="{ThemeResource DefaultTextForegroundThemeBrush}" AllowDrop="True" Drop="LeftListView_Drop"> @@ -167,9 +167,12 @@ TabIndex="1" SelectionChanged="entries_SelectionChanged" IsSynchronizedWithCurrentItem="False" - AllowDrop="{Binding IsEditMode}" - CanReorderItems="{Binding IsEditMode}" - CanDragItems="{Binding IsEditMode}"> + BorderBrush="{StaticResource ListViewItemSelectedBackgroundThemeBrush}" + AllowDrop="True" + CanReorderItems="True" + CanDragItems="True" + DragItemsStarting="GridView_DragItemsStarting" + Drop="GridView_Drop"> @@ -177,22 +180,16 @@ - + - - - - - - - + + + + + @@ -260,8 +257,36 @@ OtherItem="{StaticResource GroupOtherItem}" /> --> - --> + @@ -342,5 +367,23 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ModernKeePass/Pages/GroupDetailPage.xaml.cs b/ModernKeePass/Pages/GroupDetailPage.xaml.cs index a3164b2..6137626 100644 --- a/ModernKeePass/Pages/GroupDetailPage.xaml.cs +++ b/ModernKeePass/Pages/GroupDetailPage.xaml.cs @@ -6,6 +6,7 @@ using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; using ModernKeePass.Common; using ModernKeePass.Events; +using ModernKeePass.Services; using ModernKeePass.ViewModels; // The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229 @@ -113,9 +114,9 @@ namespace ModernKeePass.Pages ? "Are you sure you want to send the whole group and all its entries to the recycle bin?" : "Are you sure you want to delete the whole group and all its entries?"; var text = isRecycleBinEnabled ? "Item moved to the Recycle bin" : "Item permanently removed"; - MessageDialogHelper.ShowActionDialog("Warning", message, "Delete", "Cancel", a => + MessageDialogService.ShowActionDialog("Warning", message, "Delete", "Cancel", a => { - ToastNotificationHelper.ShowMovedToast(Model, "Deleting", text); + ToastNotificationService.ShowMovedToast(Model, "Deleting", text); Model.MarkForDelete(); if (Frame.CanGoBack) Frame.GoBack(); }); @@ -123,7 +124,7 @@ namespace ModernKeePass.Pages private void RestoreButton_Click(object sender, RoutedEventArgs e) { - ToastNotificationHelper.ShowMovedToast(Model, "Restored", "Item returned to its original group"); + ToastNotificationService.ShowMovedToast(Model, "Restored", "Item returned to its original group"); if (Frame.CanGoBack) Frame.GoBack(); } @@ -158,5 +159,19 @@ namespace ModernKeePass.Pages { Frame.Navigate(typeof(EntryDetailPage), Model.AddNewEntry()); } + + private void GridView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) + { + e.Cancel = !Model.IsEditMode; + } + + private void GridView_Drop(object sender, DragEventArgs e) + { + } + + private void LeftListView_Drop(object sender, DragEventArgs e) + { + + } } } diff --git a/ModernKeePass/Pages/MainPageFrames/DonatePage.xaml b/ModernKeePass/Pages/MainPageFrames/DonatePage.xaml new file mode 100644 index 0000000..12d92c5 --- /dev/null +++ b/ModernKeePass/Pages/MainPageFrames/DonatePage.xaml @@ -0,0 +1,14 @@ + + + + + +