ModernUI Tutorial: Process content navigation events and modernui content navigation

Source: Internet
Author: User

ModernUI Tutorial: Process content navigation events and modernui content navigation

The Modern UI contains an opportunity uri content navigation framework for processing area loading, detaching, and processing navigation between access records pages.

If you want your page to have these processing events, you need to inherit an IContent interface located in the FirstFloor. ModernUI. Windows namespace, which defines four methods:

1: Load And Unload

When this region in a frame is called an active region, OnNavigatedTo is called, which is the most suitable region for initialization.

OnNavigatedFrom is called when the region is about to become inactive. In this method, you can set NavigatingCancelEventArgs. Cancel to True to terminate the navigation.

* Important:

Do not rely on the Loaded and UnLoaded events of WPF to initialize and clean up the region, because when the activity region changes, Loaded and UnLoaded will be called multiple times, the reason is that TransitioningContentControl uses multiple ContentPresenters for smooth animations.

In this case, we recommend that you use the OnNavigatedTo and OnNavigatedFrom methods.

 

2: Clip navigation

The OnFragmentNavigation method is called when you start to navigate to a content clip. Fragment navigation occurs when you navigate to a page containing a fragment through URI (using the # character ).

Once your content page inherits the IContent interface, the navigation method is automatically called when the page is loaded in the Modern framework instance. The following code demonstrates how to choose to continue or terminate the navigation.

View directory

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.