Basic Navigation and Passing Data

Although it’s natural to think of a Page as the root element of a window (especially for single-page windows), all Pages are contained in a Frame. Frame provides several members to enable Page-to-Page navigation. It is often accessed from the Frame property defined on each Page.

To navigate from one page to another, you call Frame’s Navigate method with the type (not an instance) of the destination page. An instance of the new page is automatically created and navigated to, complete with a standard Windows animation.

For example, when an item is clicked in a Hub App’s SectionPage, it navigates to a new instance of ItemPage as follows:

void ItemView_ItemClick(object sender, ItemClickEventArgs ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.