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

Jump to another NavigationView Item programmatically

4 Answers 560 Views
NavigationView (Hamburger Menu)
This is a migrated thread and some comments may be shown as answers.
zigzag
Top achievements
Rank 1
zigzag asked on 10 Sep 2019, 03:31 AM

Hi,

I would like to implement a feature like below with NavigationView.

1. I use NavigationView to show a list of countries as items, say UK, USA, Australia, etc.

2. The first NavigationView Item is called "Overview". It basically displays all the countries on a TileView.

3. When user clicks one Tile on the "Overview", say "UK", I want to jump to the "UK" item of NavigationView to disaply detailed information on UK

How can do that on a MVVM way? I guess I maybe able to use SelectedItem of RadTransitionControl to achieve this, but I am not sure how exactly I can do this.

Appreciate any help.

Thanks.

4 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 12 Sep 2019, 01:38 PM

Hello Hao,

May I ask you to check out the First Look Navigation View example from our demos? It demonstrates a similar scenario to yours. In your case, I suppose that you can bind the SelectedItem of the RadTileView to the SelectedItem of the RadTransitionControl.

Please, check out the above referenced example and let me know, if you find it helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
zigzag
Top achievements
Rank 1
answered on 13 Sep 2019, 03:04 AM

Hi Vladimir,

thanks for your reply.

I managed to get it done.

1. This involves communication from one ViewModel (Tile Item) to another ViewModel (NavigationView). I use MVVMlight messager to archive this.

Messenger.Default.Send(new SwitchNavMenu(GUID));

 

2 When NavigationView receives the message, it converts the Guid to index of navigation item and set it to propoerty "SelectedIndex"

3. On RadNavigationView, I bind "SelectedIndex" to propoerty "SelectedIndex"

<telerik:RadNavigationView x:Name="navigationView"
                              Grid.Row="1"
                              ItemsSource="{Binding Items}"
                              SelectedIndex="{Binding SelectedIndex}">


0
Vladimir Stoyanov
Telerik team
answered on 13 Sep 2019, 02:10 PM

Hello Hao,

I am glad to hear that you managed to achieve what you were going for.

Thank you for sharing your approach with the community.

Regards,
Vladimir Stoyanov
Progress Telerik

Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Diego
Top achievements
Rank 1
answered on 13 Aug 2020, 04:09 PM

Any chance you can show me some more of your code of how to do this?

Tags
NavigationView (Hamburger Menu)
Asked by
zigzag
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
zigzag
Top achievements
Rank 1
Diego
Top achievements
Rank 1
Share this question
or