Skip to content

Commit

Permalink
(MahAppsGH-3768) Add Visibility property to HambugerMenuItemBase
Browse files Browse the repository at this point in the history
(MahAppsGH-3768) Add Visibility property to HambugerMenuItemBase
  • Loading branch information
punker76 committed Apr 28, 2020
1 parent 55e0d3d commit 213117d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public class HamburgerMenuItemBase : Freezable
/// </summary>
public static readonly DependencyProperty TagProperty = DependencyProperty.Register(nameof(Tag), typeof(object), typeof(HamburgerMenuItemBase), new PropertyMetadata(null));

/// <summary>
/// Identifies the <see cref="Visibility" /> dependency property.
/// </summary>
public static readonly DependencyProperty VisibilityProperty = DependencyProperty.Register(nameof(Visibility), typeof(Visibility), typeof(HamburgerMenuItemBase), new PropertyMetadata(Visibility.Visible));

/// <summary>
/// Gets or sets a value that specifies an user specific value.
/// </summary>
Expand All @@ -25,6 +30,18 @@ public object Tag
}
}

/// <summary>
/// Gets or sets the user interface (UI) visibility of this element. This is a dependency property.
/// </summary>
/// <returns>
/// A value of the enumeration. The default value is System.Windows.Visibility.Visible.
/// </returns>
public Visibility Visibility
{
get { return (Visibility)GetValue(VisibilityProperty); }
set { SetValue(VisibilityProperty, value); }
}

protected override Freezable CreateInstanceCore()
{
return new HamburgerMenuItemBase();
Expand Down
1 change: 1 addition & 0 deletions src/MahApps.Metro/Themes/HamburgerMenuTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
<Setter Property="MinHeight" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Visibility" Value="{Binding Visibility, Mode=OneWay, FallbackValue=Visible}" />
</Style>

<Style x:Key="MahApps.Styles.ListBoxItem.HamburgerMenuItem"
Expand Down

0 comments on commit 213117d

Please sign in to comment.