This is a migrated thread and some comments may be shown as answers.

Navigation from Menu control

2 Answers 102 Views
Navigation
This is a migrated thread and some comments may be shown as answers.
Vit100
Top achievements
Rank 1
Vit100 asked on 27 Apr 2010, 09:27 PM
Hi guys,
I am using Microsoft Business Template for my application and would like to use RadMenu instead of default hyperlink buttons.
Can U give me an idea how to achive this?

I created Menu and MenuItems. Then what? How to make navigation?
Telerik navigations was left only for compatibility, right?

I started using this way of navigating, but now sure is it correct.

<RadMenuItem name="RadMenuItem1" header="about page" tag="/About"/>
...
in event handler for the RadMenuItem:

this

 

 

.ContentFrame.Navigate(new Uri(RadMenuItem1.Tag.ToString(),UriKind.RelativeOrAbsolute));

 

Is this usage of the menu correct or there is more elegant way?

2 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 29 Apr 2010, 11:37 AM
Hello Vitaliy,

This usage is ok. But if you want more elegant solution then you could you radMenuItem.Command property and CommandParameter to execute command (like NavigateCommand for example - you have to create such command). In the command parameter you could specify the page to which you have to navigate. And if you use RoutedCommand then you can handle the command in the MainPage and navigate to the page in the parameter.

I'm attaching simple project demonstrating this approach.
Let us know if you need more information.

Kind regards,
Hristo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Brian
Top achievements
Rank 1
answered on 27 Sep 2011, 10:50 PM
I'd like to add for anyone trying to use the provided example in their own code: it is critical that NavigationCommands.RegisterNavigarionCommands is called before InitializeComponent is called, otherwise, the event will not fire when the menu item is clicked.  This threw me off for awhile.
Tags
Navigation
Asked by
Vit100
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Brian
Top achievements
Rank 1
Share this question
or