Intersoft ClientUI Documentation
How-to: Get the Primary Navigation Frame In a Page

This example shows how to get the UXFrame instance which is the primary navigation frame in the specified page or UIElement.

Example

Description

In certain cases, your page may contain more than one navigation frame and you would like to get the the primary navigator in that particular page, perhaps to invoke a navigation process or obtain information about the primary navigator. You can get the primary navigator in a page or UIElement by calling the GetPrimaryNavigator static method of the UXFrame.

The frame determines the primary navigator through the following mechanism:

It is best practice to consistently set the IsPrimaryNavigator to true in your navigation application, specifically for the root frame and navigation frames that integrates to browser's journal or uses child navigation. For more information about child navigation, see Advanced Features in ClientUI Navigation Framework.

Code

The following code example shows how to get the primary navigator that existed in the root visual element.

C#
Copy Code
private void DisplayErrorToNavigationFrame(ApplicationUnhandledExceptionEventArgs e)
{
    // Get the primary UXFrame that existed in root visual
    UXFrame frame = UXFrame.GetPrimaryNavigator(this.RootVisual);

    if (frame != null)
    {
        // Navigate to the error page and pass along the event data
        frame.Navigate(new Uri("/Error", UriKind.Relative), e);
    }
}
See Also

Concepts

Other Resources