Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we implement the CompactOverlay design too?! #11

Open
Dinchy87 opened this issue Sep 18, 2016 · 0 comments
Open

Can we implement the CompactOverlay design too?! #11

Dinchy87 opened this issue Sep 18, 2016 · 0 comments

Comments

@Dinchy87
Copy link

Dinchy87 commented Sep 18, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant