🐛 修复无法点击切换菜单的bug
This commit is contained in:
@@ -18,11 +18,12 @@
|
|||||||
<Setter Property="Margin" Value="0,0,0,1"/>
|
<Setter Property="Margin" Value="0,0,0,1"/>
|
||||||
<Setter Property="Background">
|
<Setter Property="Background">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<SolidColorBrush Opacity="0"/>
|
<SolidColorBrush Color="Black" Opacity="0.01"/>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||||
<EventSetter Event="MouseEnter" Handler="Menu_MouseEnter"/>
|
<EventSetter Event="MouseEnter" Handler="Menu_MouseEnter"/>
|
||||||
|
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_MouseDown"/>
|
||||||
<!--<EventSetter Event="Unselected" Handler="Lbi_Unselected"/>-->
|
<!--<EventSetter Event="Unselected" Handler="Lbi_Unselected"/>-->
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<MultiTrigger>
|
<MultiTrigger>
|
||||||
@@ -45,7 +46,11 @@
|
|||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</MultiTrigger.ExitActions>
|
</MultiTrigger.ExitActions>
|
||||||
<MultiTrigger.Setters>
|
<MultiTrigger.Setters>
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background">
|
||||||
|
<Setter.Value>
|
||||||
|
<SolidColorBrush Color="Black" Opacity="0.01"/>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</MultiTrigger.Setters>
|
</MultiTrigger.Setters>
|
||||||
</MultiTrigger>
|
</MultiTrigger>
|
||||||
@@ -133,7 +138,7 @@
|
|||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Tag="{Binding}" MouseDown="ListBoxItem_MouseDown">
|
<StackPanel Tag="{Binding}">
|
||||||
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=35}"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=35}"
|
||||||
|
|||||||
@@ -362,8 +362,31 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
{
|
{
|
||||||
MainWindow.mainWindow.HidedSearchBox();
|
MainWindow.mainWindow.HidedSearchBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ListBoxItem lbi = sender as ListBoxItem;
|
||||||
|
MenuInfo mi = lbi.DataContext as MenuInfo;
|
||||||
|
int index = MenuListBox.Items.IndexOf(mi);
|
||||||
|
MenuListBox.SelectedIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 点击菜单后 隐藏搜索框
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="sender"></param>
|
||||||
|
///// <param name="e"></param>
|
||||||
|
//private void ListBoxItemPanel_MouseDown(object sender, MouseButtonEventArgs e)
|
||||||
|
//{
|
||||||
|
// if (RunTimeStatus.SEARCH_BOX_SHOW)
|
||||||
|
// {
|
||||||
|
// MainWindow.mainWindow.HidedSearchBox();
|
||||||
|
// }
|
||||||
|
// MenuInfo mi = (sender as StackPanel).Tag as MenuInfo;
|
||||||
|
// int index = MenuListBox.Items.IndexOf(mi);
|
||||||
|
// MenuListBox.SelectedIndex = index;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 隐藏搜索框
|
/// 隐藏搜索框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user