🚸 删除空菜单不进行确认
This commit is contained in:
@@ -294,12 +294,27 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DeleteMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||
if (menuInfo.IconList != null && menuInfo.IconList.Count > 0)
|
||||
{
|
||||
HandyControl.Controls.Growl.Ask("确认删除此菜单吗?", isConfirmed =>
|
||||
{
|
||||
if (isConfirmed)
|
||||
{
|
||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||
DeleteMenu(menuInfo);
|
||||
}
|
||||
return true;
|
||||
}, "MainWindowAskGrowl");
|
||||
} else
|
||||
{
|
||||
DeleteMenu(menuInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteMenu(MenuInfo menuInfo)
|
||||
{
|
||||
if (appData.MenuList.Count == 1)
|
||||
{
|
||||
//如果删除以后没有菜单的话 先创建一个
|
||||
@@ -321,9 +336,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList;
|
||||
}
|
||||
return true;
|
||||
}, "MainWindowAskGrowl");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑菜单失焦或者敲下Enter键时保存修改后的菜单
|
||||
|
||||
Reference in New Issue
Block a user