Intersoft ClientUI Documentation
How-to: Use Menu Bar, Tool Bar and Context Menu as Navigation Source

This example shows how to use UXMenuBar, UXToolBar and UXContextMenu as navigation source.

Example

Description

The container type of UXMenuBar, UXContextMenu and UXToolBarButton is UXMenuItem. This UXMenuItem implements INavigationSource that allows the control to perform navigation to specified uri. You can implement navigation through NavigateUri properties. To learn more about navigation see Navigation Overview.

The following code shows how to use UXMenuBar, UXToolBar and UXContextMenu for navigation.

Code

XAML
Copy Code
<Intersoft:DockPanel FillChildMode="Custom">
    <Intersoft:UXMenuBar Intersoft:DockPanel.Dock="Top">
        <Intersoft:UXMenuItem Header="File">
            <Intersoft:UXMenuItem Header="New" NavigateUri="/EditorPage" />
            <Intersoft:UXMenuItem Header="Open" />
            <Intersoft:UXMenuItem Header="Save" />
        </Intersoft:UXMenuItem>
        <Intersoft:UXMenuItem Header="Help">
            <Intersoft:UXMenuItem Header="About" NavigateUri="/AboutPage" />
        </Intersoft:UXMenuItem>
    </Intersoft:UXMenuBar>
    <Intersoft:UXToolBar Intersoft:DockPanel.Dock="Top">
        <Intersoft:UXToolBarButton Content="Options" ButtonType="DropdownButton">
            <Intersoft:UXMenuItem Header="New" NavigateUri="/EditorPage" />
            <Intersoft:UXSeparator />
            <Intersoft:UXMenuItem Header="Exit" />
        </Intersoft:UXToolBarButton>
    </Intersoft:UXToolBar>
            
    <Intersoft:UXContextMenu x:Name="ListContextMenu">
        <Intersoft:UXMenuItem Header="Cut" InputGestureText="Ctrl+X" />
        <Intersoft:UXMenuItem Header="Copy" InputGestureText="Ctrl+C" />
        <Intersoft:UXMenuItem Header="Paste" InputGestureText="Ctrl+V" />
        <Intersoft:UXSeparator />
        <Intersoft:UXMenuItem Header="About" NavigateUri="/AboutPage" />
    </Intersoft:UXContextMenu>

    <Intersoft:UXFrame Intersoft:DockPanel.IsFillElement="True" Intersoft:ContextMenuService.ContextMenuName="ListContextMenu">
        <Intersoft:UXFrame.UriMapper>
            <Intersoft:UriMapper>
                <Intersoft:UriMapping Uri="" MappedUri="/Views/EditorPage.xaml" />
                <Intersoft:UriMapping Uri="/{Page}" MappedUri="/Views/{Page}.xaml" />
            </Intersoft:UriMapper>
        </Intersoft:UXFrame.UriMapper>
    </Intersoft:UXFrame>
</Intersoft:DockPanel>
See Also

Concepts

Other Resources