And then finding out that there is a better way.. LOL!
I was like.. halfway into making a hamburger style menu for a Windows 10 app then I found Jerry Nixon’s blog. LOL!
Anyways, here is what I have:
This would be your Mainpage
<Page
x:Class=”splitview.MainPage”
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
xmlns:local=”using:splitview”
xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″
xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″
mc:Ignorable=”d”>
<StackPanel Orientation=”Horizontal”>
<SplitView x:Name=”svMine” CompactPaneLength=”45″DisplayMode=”CompactInline”>
<SplitView.Pane>
<StackPanel>
<StackPanel>
<Button x:Name=”btnView” Click=”btnView_Click” FontFamily=”Segoe MDL2 Assets” Content=””></Button >
</StackPanel>
<StackPanel>
<ListBox x:Name=”lstMenuItems”SelectionChanged=”lstMenuItems_SelectionChanged”>
<ListBoxItem x:Name=”opt1″ >
<StackPanel Orientation=”Horizontal”>
<TextBlock FontFamily=”Segoe MDL2 Assets”
Text=”” Tapped=”btnView_Click”></TextBlock>
<TextBlock Text=”Option 1″ Margin=”20,0,0,0″ />
</StackPanel>
</ListBoxItem>
<ListBoxItem x:Name=”opt2″ >
<StackPanel Orientation=”Horizontal”>
<TextBlock FontFamily=”Segoe MDL2 Assets” Text=””Tapped=”btnView_Click”></TextBlock>
<TextBlock Text=”Option 2″ Margin=”20,0,0,0″/>
</StackPanel>
</ListBoxItem>
</ListBox>
</StackPanel>
</StackPanel>
</SplitView.Pane>
<SplitView.Content>
<StackPanel>
<TextBlock x:Name=”txtselected”
Text=”Content 1″></TextBlock>
</StackPanel>
</SplitView.Content>
</SplitView>
</StackPanel>
</Page>
Then this is the code
public
sealed
partial
class
MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private
void btnView_Click(object sender, RoutedEventArgs e)
{
svMine.IsPaneOpen = !svMine.IsPaneOpen;
}
private
void lstMenuItems_SelectionChanged(object sender,SelectionChangedEventArgs e)
{
txtselected.Text = lstMenuItems.SelectedIndex.ToString();
}
}
There are a lot of other details inside like where I got that Font/Character. It is embedded in VS15 actually.
Oh well..