👥 菜单删除增加询问确认

This commit is contained in:
BookerLiu
2023-03-20 14:38:36 +08:00
parent 80a9975140
commit 32adce1815
2 changed files with 27 additions and 19 deletions

View File

@@ -219,6 +219,10 @@ namespace GeekDesk.Control.UserControls.PannelCard
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void DeleteMenu(object sender, RoutedEventArgs e) private void DeleteMenu(object sender, RoutedEventArgs e)
{
HandyControl.Controls.Growl.Ask("确认删除此菜单吗?", isConfirmed =>
{
if (isConfirmed)
{ {
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo; MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
if (appData.MenuList.Count == 1) if (appData.MenuList.Count == 1)
@@ -242,6 +246,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex; appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList; appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList;
} }
return true;
}, "MainWindowAskGrowl");
}
/// <summary> /// <summary>
/// 编辑菜单失焦或者敲下Enter键时保存修改后的菜单 /// 编辑菜单失焦或者敲下Enter键时保存修改后的菜单

View File

@@ -83,6 +83,7 @@
<CheckBox x:Name="HideBox" Visibility="Hidden" Panel.ZIndex="2"/> <CheckBox x:Name="HideBox" Visibility="Hidden" Panel.ZIndex="2"/>
<StackPanel HorizontalAlignment="Right" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowGrowl" Grid.Column="1" Grid.Row="1"/> <StackPanel HorizontalAlignment="Right" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowGrowl" Grid.Column="1" Grid.Row="1"/>
<StackPanel HorizontalAlignment="Center" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowAskGrowl" Grid.Column="1" Grid.Row="1"/>
<DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove"> <DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove">
<DockPanel.Background> <DockPanel.Background>