Is there a WPF equivalent of the UWP SplitView Hamburger Menu?

Hamburg-style SplitView control on a universal Windows platform is the perfect IMO solution. However, my project has a WPF interface.

Does anyone from WPF know the equivalent of this (preferably open source)?

+5
source share
3 answers

Another implementation to learn is https://github.com/alicanerdogan/HamburgerMenu

enter image description here

+9
source
+3
source

Using the GridSplitter and StoryBoard element, you can easily set this. You may need to tweak this code a bit to make it look like a hamburger, but that should help you well.

<UserControl x:Class="Namespace.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="mainPage"> <Grid> <Grid.Resources> <Storyboard x:Name="CloseLeft"> <DoubleAnimation x:Name="animNavLinksClose" Storyboard.TargetName="mainPage" Storyboard.TargetProperty="NavLinksWidth" To="0.0" Duration="00:00:00.2" /> </Storyboard> <Storyboard x:Name="OpenLeft"> <DoubleAnimation x:Name="animNavLinksOpen" Storyboard.TargetName="mainPage" Storyboard.TargetProperty="NavLinksWidth" From="0" To="170" Duration="00:00:00.2" /> </Storyboard> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition Width="170" x:Name="NavLinksColumn" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid x:Name="grdNavLinks" Grid.Column="0"> <!-- Navigation Buttons --> </Grid> <GridSplitter x:Name="spltNavLinks" Grid.Column="1" /> <Grid x:Name="contentSection" Grid.Column="2"> <!-- Content or Frame --> </Grid> </Grid> </UserControl> 

Then you can call your storyboard from code, as shown

 // Begin Opening Animation OpenLeft.Begin(); // Begin Closing Animation CloseLeft.Begin(); 
+2
source

Source: https://habr.com/ru/post/1233617/


All Articles