I'm a little puzzled on Hamburger Menu 's DisplayMode.
I want the hamburger menu can be completely closed in Normal and wide visual states.
I try to set VisualStateWideDisplayMode
to Inline
,it's Indeed inline but the pane cannot open automaticaly.when i open the pane and click navigate to another page,the pane closed.but I want it can be always open.
I try to set IsOpen
to True,but i's no effect.
If i should write some triggers or use another way? Thanks for help.
code like this:
<Controls:HamburgerMenu x:Name="MyHamburgerMenu"
VisualStateNormalDisplayMode="Overlay"
VisualStateWideDisplayMode="Inline"
IsOpen="True"/>
I have checked the source code of Template10. It seems that it's by design. Even if you have set the DisplayMode and IsOpen value on xaml page. But in HamburgerMenu's code-behind, it always would change DisplayMode and IsOpen's value according to the VisualStateGroup.CurrentState's value. You could see this behavior in "UpdateVisualStates()" method in Template10 source code.
So I think if you want change this default behavior, you need to rebuild a custom version yourself. Or you could use SplitView to make your custom HamburgerMenu control like James Quick descirbes here: Windows 10 SplitView – Build Your First Hamburger Menu