Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HamburgerVisibility property #1020

Merged
merged 1 commit into from Mar 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -54,6 +54,7 @@
DisplayMode="@[DisplayMode:Enum:SplitViewDisplayMode.CompactInline]"
CompactPaneLength="@[CompactPaneLength:Slider:48:10-80]"
HamburgerHeight="@[HamburgerHeight:Slider:48:10-80]"
HamburgerVisibility="@[HamburgerVisibility:Enum:Visibility.Visible]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call it HamburgerButtonVisibility to avoid misunderstandings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deltakosh That was my first idea as well. But then I saw that all other properties of the hamburger button only have the "Hamburger" prefix (HamburgerHeight, HamburgerWidth, HamburgerMargin, they all affect the button and not the icon itself). So for having naming consistency, I chose to use "HamburgerVisibility". But I agree that HamburgerButtonVisibility is the better name. Shall I change it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are completely right. We can keep like it then :)

IsPaneOpen="@[IsPaneOpen:Bool:False]">
<!--Items-->
<controls:HamburgerMenu.ItemsSource>
Expand Down
Expand Up @@ -54,6 +54,7 @@
DisplayMode="{Binding DisplayMode.Value}"
Foreground="White"
HamburgerHeight="{Binding HamburgerHeight.Value}"
HamburgerVisibility="{Binding HamburgerVisibility.Value}"
HamburgerWidth="48"
IsPaneOpen="{Binding IsPaneOpen.Value, Mode=TwoWay}"
ItemClick="HamburgerMenu_OnItemClick"
Expand Down
Expand Up @@ -34,6 +34,11 @@ public partial class HamburgerMenu
/// </summary>
public static readonly DependencyProperty HamburgerMarginProperty = DependencyProperty.Register(nameof(HamburgerMargin), typeof(Thickness), typeof(HamburgerMenu), new PropertyMetadata(null));

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

/// <summary>
/// Identifies the <see cref="HamburgerMenuTemplate"/> dependency property.
/// </summary>
Expand Down Expand Up @@ -74,5 +79,14 @@ public Thickness HamburgerMargin
get { return (Thickness)GetValue(HamburgerMarginProperty); }
set { SetValue(HamburgerMarginProperty, value); }
}

/// <summary>
/// Gets or sets main button's visibility.
/// </summary>
public Visibility HamburgerVisibility
{
get { return (Visibility)GetValue(HamburgerVisibilityProperty); }
set { SetValue(HamburgerVisibilityProperty, value); }
}
}
}
Expand Up @@ -91,6 +91,7 @@
<Button Name="HamburgerButton"
Width="{TemplateBinding HamburgerWidth}"
Height="{TemplateBinding HamburgerHeight}"
Visibility="{TemplateBinding HamburgerVisibility}"
Padding="0"
VerticalAlignment="Top"
AutomationProperties.Name="Main button"
Expand Down