Pop-up dialogs and views

What’s the recommended way to make a full-screen “pop-up” view, that:

  • covers the whole screen
  • disappears again when the user presses “back”, bringing you back to where you were
  • shows up and disappears using an animation, e.g. a fade

one way is to wrap everything in a panel and use DirectNavigation and BackButtons, always returning to the main view. it doesnt feel “right” though… (?)

I guess it doesn’t feel right because what if you want to have multiple pop-ups appear on top of each other, or not being full-screen, with parts of the one below showing… that wouldn’t work with my proposed solution because the previous view would disappear when the new one appears

In order not to use Navigation for that purpose, I suggest making something like that:

<!-- Panel content -->

<While ux:Name="ModalDialogTrigger">
    <Move Target="ModalPanel" Y="-1" RelativeTo="Size" />
</While>
```

To open/close modal panel is `ModalDialogTrigger.On = true/false;`.

There could be other options on effects such as fading or scaling. And this could be not full screen modal according to applying layout.

nice! thanks!

There is a error summary about While:

E8001: Could not resolve type ‘While’

E8001: Data type not found: While

Then I tried to use WhilePressed instead of While. Another error occured:

E3104: Fuse.Gestures.WhilePressed does not contain a member called ‘On’. Could you missing a package reference?

How can I solve it? Thank you.

What version of Fuse are you using? If it is old enough, maybe you need to use ManualTrigger instead.