Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separator in a SplitView Pane

I have created a SplitView, but I have a problem in defining a Separator for the menu Option in the SplitView Pane like this in Groove Musique application:

enter image description here

I tried to use a Line shape, but I think that is not a solution.

How can I define this kind of separator in my SplitView Pane?

like image 447
user3821206 Avatar asked Jun 12 '26 18:06

user3821206


1 Answers

Using Windows 10 SplitView – Build Your First Hamburger Menu as a guide, I have adapted it as shown below using a Border and a Rectangle to achieve a separator.

Hamburger Menu With Separator

<SplitView x:Name="MySplitView" DisplayMode="CompactOverlay"  IsPaneOpen="False" 
       CompactPaneLength="50" OpenPaneLength="150">
    <SplitView.Pane>
        <StackPanel Background="Gray">
            <Button x:Name="HamburgerButton" FontFamily="Segoe MDL2 Assets" Content="&#xE700;"
             Width="50" Height="50" Background="Transparent" Click="HamburgerButton_Click"/>
            <StackPanel Orientation="Horizontal">
                <Button x:Name="MenuButton1" FontFamily="Segoe MDL2 Assets" Content="&#xE825;"
             Width="50" Height="50" Background="Transparent"/>
                <TextBlock Text="Button 1" FontSize="18" VerticalAlignment="Center" />
            </StackPanel>
            <Border BorderBrush="Red" BorderThickness="1" Width="Auto" HorizontalAlignment="Stretch" Margin="4,0"/>
            <StackPanel Orientation="Horizontal">
                <Button x:Name="MenuButton2" FontFamily="Segoe MDL2 Assets" Content="&#xE10F;"
                 Width="50" Height="50" Background="Transparent"/>
                <TextBlock Text="Button 2" FontSize="18" VerticalAlignment="Center" />
            </StackPanel>
            <Rectangle HorizontalAlignment="Stretch" Fill="Blue" Height="4" Margin="4,0"/>
            <StackPanel Orientation="Horizontal">
                <Button x:Name="MenuButton3" FontFamily="Segoe MDL2 Assets" Content="&#xE1D6;"
                 Width="50" Height="50" Background="Transparent"/>
                <TextBlock Text="Button 3" FontSize="18" VerticalAlignment="Center" />
            </StackPanel>
        </StackPanel>
    </SplitView.Pane>
    <SplitView.Content>
        <StackPanel>
            <TextBlock Text="Separator Hamburger Menu Test"/>
        </StackPanel>
    </SplitView.Content>
</SplitView>
like image 135
Kory Gill Avatar answered Jun 17 '26 10:06

Kory Gill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!