SwipeableSplitView
SwipeableSplitView copied to clipboard
Can we implement the CompactOverlay design too?!
I tried to understand you code and it works pretty well but i dont get the Generic style. How can we implement there the transition for a CompactOverlay Design?! Do we need a transition like <VisualTransition From="ClosedCompactOverlayLeft" To="OpenCompactOverlayLeft">
? and what else?! I really like this control and i think it should be built further.
I mean i have implemented the sample and set it to open on MySplitView.IsSwipeablePaneOpen = !MySplitView.IsSwipeablePaneOpen; but it opens on Mobile where i use "Overlay" and not on "CompactOverlay" that i use for PC/tablets. how to fix this?
Edit: I have "fixed" it. Added basically two more storyboards in the Generic.xaml (CloseCompactSwipeablePane and OpenCompactSwipeablePane), hooked up in the SwipeableSplitView the storyboards and the event handlers, added this on the OnDisplayModechanged for CompactOverlay:
case SplitViewDisplayMode.CompactOverlay:
PanAreaInitialTranslateX = 0d;
_overlayRoot.Visibility = Visibility.Visible;
break;
on the method OnIsSwipeablePaneOpenChanged this for CompactOverlay to trigger the new animations:
case SplitViewDisplayMode.CompactOverlay:
if (splitView.OpenCompactSwipeablePaneAnimation == null || splitView.CloseCompactSwipeablePaneAnimation == null) return;
if ((bool)e.NewValue)
{
splitView.OpenCompactSwipeablePane();
}
else
{
splitView.CloseCompactSwipeablePane();
}
break;
And i have just to clean up the code a bit on the OnManipulationCompleted to trigger the right animation based on the DisplayMode but this is it, now it supports CompactOverlay too. Maybe there was a easier way but i got it working this was.