Bookmark : string ux
Get the route from this bookmark.
Performs a transition on the router with extended options.
Note: there is also a JavaScript interface for Router.modify.
Basic use requires setting the property Bookmark
to specify the route to navigate to,
and the How
property to specify what navigation action will be used, most frequently Push
or Goto
.
<Router ux:Name="router" />
...
<JavaScript>
router.bookmark({
name: "myBookmark",
path: ["myPage", {}, "mySubpage", {}]
});
</JavaScript>
...
<Panel>
<Clicked>
<RouterModify How="Push" Bookmark="myBookmark" />
</Clicked>
<Text Value="Open subpage" />
</Panel>
If we only need to go back in navigation history, the Bookmark
property can be omitted:
<RouterModify How="GoBack" />
When using Navigator
or PageControl
, the default transitions can be overriden by setting Transition
and Style
properties on RouterModify
. This pushes another page without a transition:
<RouterModify How="Push" Transition="Bypass" Bookmark="myBookmark" />
We can use the Style
property to refer to specific Transition
triggers on target pages, allowing us
to trigger different transitions for separate use cases:
<Router ux:Name="router" />
...
<JavaScript>
router.bookmark({
name: "myBookmark",
path: ["secondPage", {}]
});
</JavaScript>
...
<Navigator DefaultPath="firstPage">
<StackPanel ux:Template="firstPage">
<Panel>
<Clicked>
<RouterModify How="Push" Bookmark="myBookmark" Style="fromTop" />
</Clicked>
<Text Value="Transition from top" />
</Panel>
<Panel>
<Clicked>
<RouterModify How="Push" Bookmark="myBookmark" Style="fromBottom" />
</Clicked>
<Text Value="Transition from bottom" />
</Panel>
</StackPanel>
<Panel ux:Template="secondPage">
<Transition Style="fromTop">
<Move Y="-1" RelativeTo="ParentSize" Duration="0.4" Easing="SinusoidalInOut" />
</Transition>
<Transition Style="fromBottom">
<Move Y="1" RelativeTo="ParentSize" Duration="0.4" Easing="SinusoidalInOut" />
</Transition>
<Clicked>
<RouterModify How="GoBack" />
</Clicked>
<Text Value="Go back" />
</Panel>
</Navigator>
Get the route from this bookmark.
How to modify the router.
The router to use. If this is null (default) then it looks through the ancestor nodes to find the nearest router.
The operation style of the transition.
How to transition to the new page.
The number of seconds after the start of the trigger that the action should be performed.
hide
hide
hide