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