Swipe added
This commit is contained in:
@@ -40,7 +40,11 @@
|
||||
<!-- http://stackoverflow.com/questions/32108362/uwp-swipe-to-open-splitview-pane-->
|
||||
<SplitView Grid.Row="1" Name="NavView" DisplayMode="Overlay" OpenPaneLength="300">
|
||||
<SplitView.Pane>
|
||||
<StackPanel>
|
||||
<StackPanel Name="MySplitviewPane" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
ManipulationMode="TranslateX"
|
||||
ManipulationCompleted="MySplitviewPane_ManipulationCompleted">
|
||||
|
||||
<ListBox SelectionMode="Single" Name="NavList" SelectionChanged="NavList_SelectionChanged">
|
||||
<ListBoxItem Name="NavListHelp">
|
||||
<StackPanel Style="{StaticResource NavStackPanel}">
|
||||
@@ -58,7 +62,17 @@
|
||||
</StackPanel>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<Frame Name="Frame"/>
|
||||
<Grid>
|
||||
<Frame Name="Frame"/>
|
||||
|
||||
<Grid ManipulationMode="TranslateX"
|
||||
ManipulationCompleted="Grid_ManipulationCompleted"
|
||||
Width="150"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch">
|
||||
</Grid>
|
||||
</Grid>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</Grid>
|
||||
|
||||
@@ -101,5 +101,21 @@ namespace NavCityBreda
|
||||
Frame.Navigate(typeof(SettingsView));
|
||||
}
|
||||
}
|
||||
|
||||
private void Grid_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
|
||||
{
|
||||
if (e.Cumulative.Translation.X > 50)
|
||||
{
|
||||
NavView.IsPaneOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void MySplitviewPane_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
|
||||
{
|
||||
if (e.Cumulative.Translation.X < -50)
|
||||
{
|
||||
NavView.IsPaneOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user