mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-11-30 10:57:51 +08:00
fixed #248
This commit is contained in:
parent
fc69669b06
commit
35abb9d02c
@ -40,6 +40,8 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (item.Role == SideMenuItemRole.Item)
|
||||
{
|
||||
_isItemSelected = true;
|
||||
|
||||
if (Equals(item, _selectedItem)) return;
|
||||
|
||||
if (_selectedItem != null)
|
||||
@ -53,7 +55,6 @@ namespace HandyControl.Controls
|
||||
{
|
||||
Info = e.OriginalSource
|
||||
});
|
||||
_isItemSelected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -92,7 +93,10 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else if(_selectedHeader != null)
|
||||
{
|
||||
_selectedHeader.SelectDefaultItem();
|
||||
if (AutoSelect)
|
||||
{
|
||||
_selectedHeader.SelectDefaultItem();
|
||||
}
|
||||
_isItemSelected = false;
|
||||
}
|
||||
}
|
||||
@ -117,6 +121,15 @@ namespace HandyControl.Controls
|
||||
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is SideMenuItem;
|
||||
|
||||
public static readonly DependencyProperty AutoSelectProperty = DependencyProperty.Register(
|
||||
"AutoSelect", typeof(bool), typeof(SideMenu), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
|
||||
public bool AutoSelect
|
||||
{
|
||||
get => (bool) GetValue(AutoSelectProperty);
|
||||
set => SetValue(AutoSelectProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register(
|
||||
"ExpandMode", typeof(ExpandMode), typeof(SideMenu), new PropertyMetadata(default(ExpandMode), OnExpandModeChanged));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user