How to show window in telerik:RadNavigationView.Content

1 Answer 467 Views
NavigationView (Hamburger Menu)
Pravin
Top achievements
Rank 1
Pravin asked on 13 Feb 2022, 05:13 PM

Dear Team,

how i can show/load Dashboard.xaml page in RadNavigationView.Content on click of Dashboard View Item

 

<telerik:RadNavigationView x:Name="navigationView"
                                   PaneHeader="RadNavigationView"
                                   SelectedIndex="0"
                                   DisplayMode="Expanded"
                                   AutoChangeDisplayMode="False">
            <telerik:RadNavigationView.Items>
                <telerik:RadNavigationViewItem Content="Dashbard" Icon="&#xe303;" IconTemplate="{StaticResource IconTemplate}"  Click="RadNavigationViewItem_Click" />
                <telerik:RadNavigationViewItem Content="a" Icon="&#xe301;" IconTemplate="{StaticResource IconTemplate}"  />
                <telerik:RadNavigationViewItem Content="B" Icon="&#xe132;" IconTemplate="{StaticResource IconTemplate}"  />
                <telerik:RadNavigationViewItem Content="c" Icon="&#xe906;" IconTemplate="{StaticResource IconTemplate}"  />
            </telerik:RadNavigationView.Items>
            <telerik:RadNavigationView.PaneFooter>
                <telerik:RadNavigationViewItem Content="About" Icon="&#xe401;" 
                                               IconTemplate="{StaticResource IconTemplate}" 
                                               CommandParameter="{Binding ElementName=navigationView}"  />
            </telerik:RadNavigationView.PaneFooter>
            <telerik:RadNavigationView.Content>
                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                   
                </StackPanel>
            </telerik:RadNavigationView.Content>
        </telerik:RadNavigationView>


1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 14 Feb 2022, 03:29 PM

Hello Pravin,

One way of achieving this requirement is to subscribe to the SelectionChanged event of RadNavigationView control. Each time you select a RadNavigationViewItem, the event fires, and in the event handler you can get the UserControl that should be displayed and assign it to the Content property of the RadNavigationView control instance.

In addition, you could use a custom ContentTemplateSelector where each expected view has a DataTemplate defined. This will allow you to display complex views with multiple controls inside them. This approach is shown in the First Look example of the RadNavigationView control in the WPF Demos application. The First Look demo utilizes the SelectedItem property of the RadNavigationView control which is bound to the Content property of RadTransitionControl content control.

With that said, could you give these suggestions a try?

Regards,
Stenly
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
NavigationView (Hamburger Menu)
Asked by
Pravin
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or