HamburgerMenu Class
Control to implement the Hamburger style menu (or Navigation Drawer) control.
1. Add a namespace attribute to the root element of the markup file it is to be used in:
xmlns:cc="clr-namespace:Common.Wpf.Controls;assembly=Common.Wpf.Controls"
2. Define the control with menu items:
<cc:HamburgerMenu IsOpen="{Binding IsChecked, ElementName=cbToggleMenu}" ...>
<custom:HamburgerMenu.Content>
<StackPanel Margin="0 10">
<custom:HamburgerMenuItem>
<TextBlock Text="Introduction"/>
</custom:HamburgerMenuItem>
</StackPanel>
</custom:HamburgerMenu.Content>
</cc:HamburgerMenu>
3. In the
ViewModel create the properties for binding:
public bool IsMenuOpen => _navigationStore.IsMenuOpen;
HamburgerMenu | Initializes a new instance of the HamburgerMenu class. |
Content | Gets or sets the menu content. |
FallBackOpenWidth | Gets or sets the fall-back menu open width. The default is 100. |
IsOpen | Gets or sets the menu open indicator. The default is . |
OpenCloseDuration | Gets or sets the menu open duration. The default is Automatic. |