Reputation: 3223
I am currently building app for Windows 10 using UWP, XAML
and C#
. I have an app, in which I need to have a menu, and a left pane. See this example of left menu :
Image - The Next Web
The pane needs to be always open. This is what I currently have in my MainPage.xaml
:
<SplitView x:Name="MySplitView" DisplayMode="CompactOverlay" IsPaneOpen="False"
CompactPaneLength="50" OpenPaneLength="200">
<SplitView.Pane>
<StackPanel Background="Gray">
<Button x:Name="HamburgerButton" FontFamily="Segoe MDL2 Assets" Content=""
Width="50" Height="50" Background="Transparent" Click="HamburgerButton_Click"/>
<StackPanel Orientation="Horizontal">
<Button x:Name="HomeButton" FontFamily="Segoe MDL2 Assets" Content=""
Width="50" Height="50" Background="Transparent" Click="HomeButton_Click"/>
<TextBlock Text="Accueil" FontSize="18" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button x:Name="CommisButton" FontFamily="Segoe MDL2 Assets" Content=""
Width="50" Height="50" Background="Transparent" Click="CommisButton_Click"/>
<TextBlock Text="Commis" FontSize="18" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button x:Name="CommentsButton" FontFamily="Segoe MDL2 Assets" Content=""
Width="50" Height="50" Background="Transparent" Click="CommentsButton_Click"/>
<TextBlock Text="Commentaires" FontSize="18" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button x:Name="SettingsButton" FontFamily="Segoe MDL2 Assets" Content=""
Width="50" Height="50" Background="Transparent" Click="SettingsButton_Click"/>
<TextBlock Text="Paramètres" FontSize="18" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</SplitView.Pane>
<SplitView.Content>
<!-- My Content -->
</SplitView.Content>
</SplitView>
I have tried to make another SplitView.Pane
but it doesn’t succeed. I need a way to make a left panel, thats it!
Thanks
Upvotes: 0
Views: 2562
Reputation: 4569
In your SplitView.Content
, add another SplitView
.
<SplitView.Content>
<!-- My Content -->
<SplitView x:Name="MyRisksPane" IsPaneOpen="True" OpenPaneLength="350" Background="White" DisplayMode="Inline">
<SplitView.Pane>
<!-- Your SplitView.Pane content goes here -->
</SplitView.Pane>
<SplitView.Content>
<Frame x:Name="FrameDetailPane"/>
</SplitView.Content>
</SplitView>
</SplitView.Content>
Upvotes: 3