Hamburger menu button visibility is now a property

Hamburger menu now has a display member path property
This commit is contained in:
BONNEVILLE Geoffroy
2018-06-15 10:10:48 +02:00
parent 2b48b64f2f
commit 62c9719a77
3 changed files with 30 additions and 8 deletions

View File

@@ -7,7 +7,6 @@ using ModernKeePass.Interfaces;
namespace ModernKeePass.Views.UserControls
{
// TODO: Add a property (string path) that allows chosing which field to display
public sealed partial class HamburgerMenuUserControl
{
public HamburgerMenuUserControl()
@@ -32,7 +31,6 @@ namespace ModernKeePass.Views.UserControls
get { return (string)GetValue(ButtonLabelProperty); }
set { SetValue(ButtonLabelProperty, value); }
}
// TODO: set a boolean that will show/hide the button when a value is set/not set
public static readonly DependencyProperty ButtonLabelProperty =
DependencyProperty.Register(
"ButtonLabel",
@@ -40,6 +38,18 @@ namespace ModernKeePass.Views.UserControls
typeof(HamburgerMenuUserControl),
new PropertyMetadata("Button", (o, args) => { }));
public string DisplayMemberPath
{
get { return (string)GetValue(DisplayMemberPathProperty); }
set { SetValue(DisplayMemberPathProperty, value); }
}
public static readonly DependencyProperty DisplayMemberPathProperty =
DependencyProperty.Register(
"DisplayMemberPath",
typeof(string),
typeof(HamburgerMenuUserControl),
new PropertyMetadata("Name", (o, args) => { }));
public object ResizeTarget
{
get { return GetValue(ResizeTargetProperty); }
@@ -52,6 +62,18 @@ namespace ModernKeePass.Views.UserControls
typeof(HamburgerMenuUserControl),
new PropertyMetadata(null, (o, args) => { }));
public bool IsButtonVisible
{
get { return (bool)GetValue(IsButtonVisibleProperty); }
set { SetValue(IsButtonVisibleProperty, value); }
}
public static readonly DependencyProperty IsButtonVisibleProperty =
DependencyProperty.Register(
"IsButtonVisible",
typeof(bool),
typeof(HamburgerMenuUserControl),
new PropertyMetadata(false, (o, args) => { }));
public IEnumerable<IPwEntity> ItemsSource
{
get { return (IEnumerable<IPwEntity>)GetValue(ItemsSourceProperty); }