👥 菜单删除增加询问确认
This commit is contained in:
@@ -220,27 +220,34 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
/// <param name="e"></param>
|
||||
private void DeleteMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||
if (appData.MenuList.Count == 1)
|
||||
HandyControl.Controls.Growl.Ask("确认删除此菜单吗?", isConfirmed =>
|
||||
{
|
||||
//如果删除以后没有菜单的话 先创建一个
|
||||
CreateMenu(null, null);
|
||||
}
|
||||
int index = appData.MenuList.IndexOf(menuInfo);
|
||||
if (index == 0)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
index--;
|
||||
}
|
||||
if (isConfirmed)
|
||||
{
|
||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||
if (appData.MenuList.Count == 1)
|
||||
{
|
||||
//如果删除以后没有菜单的话 先创建一个
|
||||
CreateMenu(null, null);
|
||||
}
|
||||
int index = appData.MenuList.IndexOf(menuInfo);
|
||||
if (index == 0)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
index--;
|
||||
}
|
||||
|
||||
appData.MenuList.Remove(menuInfo);
|
||||
// 选中下一个菜单
|
||||
MenuListBox.SelectedIndex = index;
|
||||
appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList;
|
||||
appData.MenuList.Remove(menuInfo);
|
||||
// 选中下一个菜单
|
||||
MenuListBox.SelectedIndex = index;
|
||||
appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList;
|
||||
}
|
||||
return true;
|
||||
}, "MainWindowAskGrowl");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
<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="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.Background>
|
||||
|
||||
Reference in New Issue
Block a user