<Window x:Class="WpfApp123.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
		xmlns:searchPanel="clr-namespace:Telerik.Windows.Controls.GridView.SearchPanel;assembly=Telerik.Windows.Controls.GridView"
		xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        xmlns:local="clr-namespace:WpfApp123"
        mc:Ignorable="d"
        Height="500" Width="500">

	<Window.DataContext>
		<local:MainWindowViewModel/>
	</Window.DataContext>

	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="pack://application:,,,/WpfApp123;component/ResourceTemplate.xaml" />
			</ResourceDictionary.MergedDictionaries>

			<telerik:StringToGlyphConverter x:Key="StringToGlyphConverter" />
			<local:MainWindowViewModel x:Key="MainWindowViewModel" />

			<DataTemplate x:Key="NavigationView">
				<local:NavigationView DataContext="{DynamicResource MainWindowViewModel}" />
			</DataTemplate>
			<DataTemplate x:Key="NavigationEmptyView"/>

			<local:NavigationItemContentTemplateSelector x:Key="NavigationItemContentTemplateSelector"
				NavigationView ="{StaticResource NavigationView}"
				NavigationEmptyView ="{StaticResource NavigationEmptyView}"
				/>

		</ResourceDictionary>
	</Window.Resources>

	<Grid>
		<telerik:RadNavigationView	x:Name="radNavigationView"
									ItemsSource="{Binding Navigations}"
									DisplayMemberPath="Title"
									PaneHeader="Menu"
									DisplayMode="Expanded"
									AutoChangeDisplayMode="False"
									SelectedIndex="0"
									>
			<telerik:RadNavigationView.Resources>
				<Style x:Key="BaseNavigationViewItemStyle" TargetType="telerik:RadNavigationViewItem" BasedOn="{StaticResource RadNavigationViewItemStyle}">
					<Setter Property="DisplayMemberPath" Value="Title" />
					<Setter Property="Icon" Value="{Binding IconGlyph}" />
					<Setter Property="IconTemplate">
						<Setter.Value>
							<DataTemplate>
								<telerik:RadGlyph Glyph="{Binding Converter={StaticResource StringToGlyphConverter}}" />
							</DataTemplate>
						</Setter.Value>
					</Setter>
				</Style>
			</telerik:RadNavigationView.Resources>

			<telerik:RadNavigationView.ItemContainerStyle>
				<Style TargetType="telerik:RadNavigationViewItem" BasedOn="{StaticResource BaseNavigationViewItemStyle}">
					<Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
					<Setter Property="IsSelectable" Value="{Binding IsSelectable}"/>
					<Setter Property="IsExpanded" Value="{Binding IsExpanded}"/>
					<Setter Property="ItemsSource" Value="{Binding SubItems}" />
					<Setter Property="ItemContainerStyle" Value="{StaticResource BaseNavigationViewItemStyle}" />
				</Style>
			</telerik:RadNavigationView.ItemContainerStyle>
			
			<telerik:RadNavigationView.Content>
				<ContentControl Content="{Binding SelectedItem, ElementName=radNavigationView}"
								ContentTemplateSelector="{StaticResource NavigationItemContentTemplateSelector}" />
			</telerik:RadNavigationView.Content>
		</telerik:RadNavigationView>
	</Grid>
</Window>
