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