Close EdgeNavigator on swipe from right


I want to close the opened EdgeNavigation when I swipe from the right side to the left, so the reverse opening mechanism.

I tried this:

<WhileEdgeSwiped Edge="Right">


But this doesn’t exist anymore.

WhileEdgeSwiped has been renamed to EdgeSwipeAnimation in Fuse 0.12. It seems that this has mysteriously slipped the change log, sorry about that!

Happens :slight_smile:

But it only fires once, I want to close the EdgeNavigator with a swipe from the right side, additionally to the tap:

<EdgeNavigator ux:Name="EdgeNavigator">

  <EdgeSwipeAnimation Edge="Right">
    <DebugAction Message="Right edge got swiped" />
    <NavigateTo Target="dashboard" /> // By the way, any better solution to close the EdgeNavigator?


You shouldn’t mix EdgeNavigator and EdgeSwipeAnimation. EdgeNavigator is a high-level wrapper for edge panels that takes care of all the swiping and active navigation status.

If you need to key something to the active status of the edge panel use ActivatingAnimation, WhileActive or another such navigation trigger on that panel.

If you need something lower level then consider just using SwipeGesture instead and specify an edge for it. The EdgeSwipeAnimation looks like it might be destined for deprecation.

SwipeGesture doesn’t allow child elements, how can this trigger the close?

Edit: this works:

<SwipeGesture ux:Name="swipe" Edge="Right" />
<SwipingAnimation Source="swipe">
    <DebugAction Message="Right edge got swiped" />
    <NavigateTo Target="dashboard" />

Still, is there a better way to close the edgenavigator?

You may wish to use the Swiped trigger instead of SwipingAnimation, as it’s tied to the firing of the action instead of being an animation bound trigger. You can also set the Type="Simple" on the SwipeGesture so it doesn’t have an open/close state: it’ll be just the raw gesture.

There isn’t really another option now.