From 34f5f2f6c8071e2e1bc66028c504cb7eeea2bc28 Mon Sep 17 00:00:00 2001 From: BONNEVILLE Geoffroy Date: Mon, 2 Jul 2018 18:23:43 +0200 Subject: [PATCH] WIP Top Menu --- ModernKeePass/ModernKeePass.App.csproj | 7 ++ ModernKeePass/Strings/en-US/Resources.resw | 12 +++ ModernKeePass/Strings/fr-FR/Resources.resw | 12 +++ ModernKeePass/Views/GroupDetailPage.xaml | 16 +++- .../HamburgerMenuUserControl.xaml | 34 ++++++- .../UserControls/TopMenuUserControl.xaml | 79 ++++++++++++++++ .../UserControls/TopMenuUserControl.xaml.cs | 92 +++++++++++++++++++ 7 files changed, 245 insertions(+), 7 deletions(-) create mode 100644 ModernKeePass/Views/UserControls/TopMenuUserControl.xaml create mode 100644 ModernKeePass/Views/UserControls/TopMenuUserControl.xaml.cs diff --git a/ModernKeePass/ModernKeePass.App.csproj b/ModernKeePass/ModernKeePass.App.csproj index 5add6ba..5749688 100644 --- a/ModernKeePass/ModernKeePass.App.csproj +++ b/ModernKeePass/ModernKeePass.App.csproj @@ -239,6 +239,9 @@ SymbolPickerUserControl.xaml + + TopMenuUserControl.xaml + @@ -374,6 +377,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + diff --git a/ModernKeePass/Strings/en-US/Resources.resw b/ModernKeePass/Strings/en-US/Resources.resw index 3695a92..ab64136 100644 --- a/ModernKeePass/Strings/en-US/Resources.resw +++ b/ModernKeePass/Strings/en-US/Resources.resw @@ -408,4 +408,16 @@ Create a new entry + + Home + + + Home + + + Settings + + + Settings + \ No newline at end of file diff --git a/ModernKeePass/Strings/fr-FR/Resources.resw b/ModernKeePass/Strings/fr-FR/Resources.resw index 124a389..501cef1 100644 --- a/ModernKeePass/Strings/fr-FR/Resources.resw +++ b/ModernKeePass/Strings/fr-FR/Resources.resw @@ -408,4 +408,16 @@ Créer une nouvelle entrée + + Accueil + + + Accueil + + + Paramètres + + + Paramètres + \ No newline at end of file diff --git a/ModernKeePass/Views/GroupDetailPage.xaml b/ModernKeePass/Views/GroupDetailPage.xaml index 82340ae..a8d1134 100644 --- a/ModernKeePass/Views/GroupDetailPage.xaml +++ b/ModernKeePass/Views/GroupDetailPage.xaml @@ -243,6 +243,7 @@ + - - + @@ -310,9 +310,12 @@ - + + + + @@ -326,6 +329,9 @@ + + + diff --git a/ModernKeePass/Views/UserControls/HamburgerMenuUserControl.xaml b/ModernKeePass/Views/UserControls/HamburgerMenuUserControl.xaml index 8332659..5bce66a 100644 --- a/ModernKeePass/Views/UserControls/HamburgerMenuUserControl.xaml +++ b/ModernKeePass/Views/UserControls/HamburgerMenuUserControl.xaml @@ -69,9 +69,9 @@ - + - + + diff --git a/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml b/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml new file mode 100644 index 0000000..23bdd83 --- /dev/null +++ b/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml.cs b/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml.cs new file mode 100644 index 0000000..e0cf9c8 --- /dev/null +++ b/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml.cs @@ -0,0 +1,92 @@ +using System.Windows.Input; +using Windows.UI.Xaml; + +// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 + +namespace ModernKeePass.Views.UserControls +{ + public sealed partial class TopMenuUserControl + { + public string VisualState + { + get { return (string)GetValue(VisualStateProperty); } + set + { + SetValue(VisualStateProperty, value); + VisualStateManager.GoToState(this, value, true); + } + } + public static readonly DependencyProperty VisualStateProperty = + DependencyProperty.Register( + "VisualState", + typeof(string), + typeof(TopMenuUserControl), + new PropertyMetadata("Large", (o, args) => { })); + + public ICommand SaveCommand + { + get { return (ICommand)GetValue(SaveCommandProperty); } + set { SetValue(SaveCommandProperty, value); } + } + public static readonly DependencyProperty SaveCommandProperty = + DependencyProperty.Register( + "SaveCommand", + typeof(ICommand), + typeof(TopMenuUserControl), + new PropertyMetadata(null, (o, args) => { })); + + public ICommand EditCommand + { + get { return (ICommand)GetValue(EditCommandProperty); } + set { SetValue(EditCommandProperty, value); } + } + public static readonly DependencyProperty EditCommandProperty = + DependencyProperty.Register( + "EditCommand", + typeof(ICommand), + typeof(TopMenuUserControl), + new PropertyMetadata(null, (o, args) => { })); + + public ICommand DeleteCommand + { + get { return (ICommand)GetValue(DeleteCommandProperty); } + set { SetValue(DeleteCommandProperty, value); } + } + public static readonly DependencyProperty DeleteCommandProperty = + DependencyProperty.Register( + "DeleteCommand", + typeof(ICommand), + typeof(TopMenuUserControl), + new PropertyMetadata(null, (o, args) => { })); + + public ICommand RestoreCommand + { + get { return (ICommand)GetValue(RestoreCommandProperty); } + set { SetValue(RestoreCommandProperty, value); } + } + public static readonly DependencyProperty RestoreCommandProperty = + DependencyProperty.Register( + "RestoreCommand", + typeof(ICommand), + typeof(TopMenuUserControl), + new PropertyMetadata(null, (o, args) => { })); + + public bool ShowRestoreButton + { + get { return (bool)GetValue(ShowRestoreButtonProperty); } + set { SetValue(ShowRestoreButtonProperty, value); } + } + public static readonly DependencyProperty ShowRestoreButtonProperty = + DependencyProperty.Register( + "ShowRestoreButton", + typeof(bool), + typeof(TopMenuUserControl), + new PropertyMetadata(false, (o, args) => { })); + + + public TopMenuUserControl() + { + InitializeComponent(); + } + } +}