# Activating an animation from two different triggers (and similar for navigation and pages)

**URL:** <https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743>\
**Category:** How-to Discussions\
**Created:** [April 21, 2015, 10:03pm UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743 "2015-04-21T22:03:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eivind](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eivind/32/575_2.png) [@Eivind](https://forums.fusetools.com/u/Eivind)\
**Post date:** [April 21, 2015, 10:03pm UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/1 "2015-04-21T22:03:11Z")

</div>

Case 1: I have a side-menu that I’m able to activate with an edge-swipe like so: Would be nice though, if this could be done by pressing a menu button as well. What’s the recommended way to do this? Is there a way the menu button can activate the same trigger?

Case 2, which is about navigation: I’m using a LinearNavigation to navigate between a set of Pages by button-press, like in your DemoApp2. How would I go about to also allow the user to swipe back and forth to change the pages?

Finally, would it maybe be possible to get access to some of your older example-apps (such as SquareUp, and maybe the things you show in your videos? I do understand that it may no longer be compiling!)

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [April 22, 2015, 9:44am UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/2 "2015-04-22T09:44:50Z")

</div>

There is no nice way to enable or disable a [`WhileEdgeSwiped`](https://www.fusetools.com/developers/api/fuse/triggers/whileedgeswiped) trigger from UX at the moment. You have to do it from a codebehind, calling either `Enabled()` or `Disable()` on the trigger. We feel like the `WhileEdgeSwiped` trigger is somewhat lowleve and are discussing a higher level Control for dealing with slide-in menus.

If you want to have use swiping to navigate in a panel that has a navigation behavior you just add the [`SwipeNavigate`](https://www.fusetools.com/developers/api/fuse/navigation/swipenavigate) behavior and you are good to go (be sure to set the correct `SwipeDirection` according to your `Enter/Exit` triggers).

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [April 22, 2015, 9:48am UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/3 "2015-04-22T09:48:23Z")

</div>

As for our older examples, they are so out of date since we have been iterating so hard on the fuse libraries that I do not think they will really have any value.

We are working hard on getting out more examples though.

And do not hesitate to ask in the forum if you have any questions for how to go about making stuff with fuse 🙂

---

<div class="post-metadata">

**Author:** ![Cristian\_Karmy1](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cristian_karmy1/32/480_2.png) [@Cristian\_Karmy1](https://forums.fusetools.com/u/Cristian_Karmy1)\
**Post date:** [April 22, 2015, 6:43pm UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/4 "2015-04-22T18:43:52Z")

</div>

I have a similar problem. I have a animation that is trigger by a ManualTrigger (with Poniter.Pressed) and a WhileEdgeSwiped.

I have something like that:

```auto

< ManualTrigger ux:Name="MyTrigger">
< Move...... />
< /ManualTrigger>

< WhileEdgeSwiped Edge="Left" VelocityThreshold="200" EdgeThreshold="400" >
        < Change Target="MyTrigger.On" Value="true" />
< /WhileEdgeSwiped>

```

The problem is that when I trigger the ManualTrigger I cant back with the WhileEdgeSwiped.

How can I Activate the WhileEdgeSwiped in this code?:

```auto

    void PoPointerPressed(object sender, PointerPressedArgs args)
{
     MyTrigger.On = true;
}

```

---

<div class="post-metadata">

**Author:** ![Eivind](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eivind/32/575_2.png) [@Eivind](https://forums.fusetools.com/u/Eivind)\
**Post date:** [April 22, 2015, 11:32pm UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/5 "2015-04-22T23:32:39Z")

</div>

Vegard: I don’t know if I understand you correctly, but as cpacheco says, I don’t want to disable the trigger, I want to be able to make the menu appear and disappear in two different ways: with an edge-swipe, and by pressing a menu button. Not sure if this was understood. Will try though to call Enable and Disable from the code-behind when the user presses the button…

Regarding the Navigator classes: There currently isn’t any form of documentation (neither API docs, examples, or tutorials) that show how to use other navigators than the LinearNavigator. I don’t currently understand what the difference is between them, and how to use even the DirectNavigator…

---

<div class="post-metadata">

**Author:** ![Eivind](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eivind/32/575_2.png) [@Eivind](https://forums.fusetools.com/u/Eivind)\
**Post date:** [April 23, 2015, 12:13am UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/6 "2015-04-23T00:13:41Z")

</div>

Is it possible to look at the source code for the built-in uno libraries?

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [April 23, 2015, 10:50am UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/7 "2015-04-23T10:50:25Z")

</div>

What I meant is that you could use Enable/Disable on the `WhileEdgeSwiped` trigger as a means to make the menu appear and disappear by pressing a button.

I am sorry for the lack of examples we have at the moment, Ill try to flesh how the different navigation behaviors work.

- `LinearNavigation`

- `HierarchicalNavigation`

- `DirectNavigation`

I hope this explanation make some sense? If not, let me know 🙂

If you want to look at the code you can use the Go to definition feature in sublime text 🙂

![](http://img.ctrlv.in/img/15/04/23/5538ce3b1f654.png)

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [April 23, 2015, 10:51am UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/8 "2015-04-23T10:51:33Z")

</div>

cpacheco, if you give the `WhileEdgeSwiped` an `ux:Name="..."` you can call Enable/Disable on it from your codebehind 🙂

---

<div class="post-metadata">

**Author:** ![Cristian\_Karmy1](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cristian_karmy1/32/480_2.png) [@Cristian\_Karmy1](https://forums.fusetools.com/u/Cristian_Karmy1)\
**Post date:** [April 23, 2015, 1:09pm UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/9 "2015-04-23T13:09:57Z")

</div>

Perfect! Now its work!

And a basic question… For example, how I put ux:Name=“p3” Active Panel? This is in UX?

Eivind Liland: To Active WhileEdgeSwiped is Enable() and to disable, Disable().

Like this:

```auto

< WhileEdgeSwiped ux:Name="MyTrigger">
< /WhileEdgeSwiped>

< Button PointerPressed="ActivateTrigger"/>

```

In codeBehind

```auto

    void ActivateTrigger(object sender, PointerPressedArgs args)
{
     MyTrigger.Enable();
}

```

---

<div class="post-metadata">

**Author:** ![Eivind](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eivind/32/575_2.png) [@Eivind](https://forums.fusetools.com/u/Eivind)\
**Post date:** [April 27, 2015, 8:08pm UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/10 "2015-04-27T20:08:21Z")

</div>

Thank you! A few gems here from both of you 🙂

---

<div class="post-metadata">

**Author:** ![Eivind](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eivind/32/575_2.png) [@Eivind](https://forums.fusetools.com/u/Eivind)\
**Post date:** [June 20, 2015, 10:49am UTC](https://forums.fusetools.com/t/activating-an-animation-from-two-different-triggers-and-similar-for-navigation-and-pages/6743/11 "2015-06-20T10:49:47Z")

</div>

Keep coming back to this post by Vegard. It was very helpful.

Question: With DirectNavigation now supporting history tracking, what’s the difference to HierarchicalNavigation?

Question 2: What is actually PageControl? It kind of just acts like a Panel with an embedded LinearNavigation, so what’s the point of it?

- Same with EdgeNavigator - it seems you should be able to do the same with a combination of a Panel, a LinearNavigation, and an EdgeSwiped?
