Hello.
I found something unknown while using the hierarchical menu.
Click the hierarchical menu and click the ESC or menu to hide the hierarchical menu.
I made it short as a gif, but I hope it helps you understand.
Attach the source. What is the problem.
Xaml
<
Grid
>
<
Grid.Resources
>
<
telerik:StringToGlyphConverter
x:Key
=
"StringToGlyphConverter"
/>
<
Style
x:Key
=
"BaseNavigationViewItemStyle"
TargetType
=
"telerik:RadNavigationViewItem"
BasedOn
=
"{StaticResource RadNavigationViewItemStyle}"
>
<
Setter
Property
=
"DisplayMemberPath"
Value
=
"Title"
/>
<
Setter
Property
=
"Icon"
Value
=
"{Binding Glyph}"
/>
<
Setter
Property
=
"IconTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
telerik:RadGlyph
Glyph
=
"{Binding Converter={StaticResource StringToGlyphConverter}}"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
<
Style
x:Key
=
"NavigationSubItemStyle"
TargetType
=
"telerik:RadNavigationViewItem"
BasedOn
=
"{StaticResource BaseNavigationViewItemStyle}"
>
<
Setter
Property
=
"IconVisibility"
Value
=
"Collapsed"
/>
</
Style
>
</
Grid.Resources
>
<
telerik:RadNavigationView
Grid.Row
=
"1"
CanKeyboardNavigationSelectItems
=
"True"
CompactPaneWidth
=
"60"
AutoChangeDisplayMode
=
"False"
DisplayMode
=
"Expanded"
DisplayMemberPath
=
"Title"
PaneHeader
=
"{Binding Header, Mode=OneTime}"
ItemsSource
=
"{Binding Menu1}"
SelectedItem
=
"{Binding MenuItem1, Mode=TwoWay}"
>
<
telerik:RadNavigationView.ItemContainerStyle
>
<
Style
TargetType
=
"telerik:RadNavigationViewItem"
BasedOn
=
"{StaticResource BaseNavigationViewItemStyle}"
>
<
Setter
Property
=
"ItemsSource"
Value
=
"{Binding SubItems}"
/>
<
Setter
Property
=
"ItemContainerStyle"
Value
=
"{StaticResource NavigationSubItemStyle}"
/>
</
Style
>
</
telerik:RadNavigationView.ItemContainerStyle
>
<
telerik:RadNavigationView.Content
>
<
ContentControl
Content
=
"{Binding ViewContent, Mode=TwoWay}"
/>
</
telerik:RadNavigationView.Content
>
</
telerik:RadNavigationView
>
</
Grid
>
ViewModel
private
void
Data()
{
var multiBatchView =
new
MultiBatchView();
Menu1.Add(
new
navi
{
Glyph =
""
,
Title =
"Multi File Check"
,
TypeUserControl = multiBatchView,
});
Menu1.Add(
new
navi
{
Title =
"Settings"
,
Glyph =
""
,
TypeUserControl =
null
,
SubItems =
new
ObservableCollection<navi>
{
new
navi
{
Title =
"Test"
,
TypeUserControl =
null
,
},
new
navi
{
Title =
"Overlap"
,
TypeUserControl = optionOverlapView,
},
new
navi
{
Title =
"Connection"
,
TypeUserControl = optionConnectionView
},
new
navi
{
Title =
"Quality"
,
TypeUserControl = optionQualityView
},
new
navi
{
Title =
"Export/Import"
,
TypeUserControl = optionExportImportView
},
}
});
MenuItem1 = Menu1.FirstOrDefault();
}
Model
public
class
navi
{
public
string
Glyph {
get
;
set
; }
public
string
Title {
get
;
set
; }
public
UserControl TypeUserControl {
get
;
set
; }
public
ObservableCollection<navi> SubItems {
get
;
set
; }
}
Thanks.