增加可拖动到其它菜单功能 切换了icon动画

This commit is contained in:
liufei
2022-06-01 15:55:33 +08:00
parent 4c5c88769f
commit b47dd0fbf7
9 changed files with 1388 additions and 191 deletions

View File

@@ -312,6 +312,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (IS_EDIT) return;
MainWindow.mainWindow.RightCard.WrapCard.Visibility = Visibility.Collapsed;
//设置对应菜单的图标列表
if (MenuListBox.SelectedIndex == -1)
{
@@ -321,6 +324,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
}
MainWindow.mainWindow.RightCard.WrapCard.Visibility = Visibility.Visible;
}
@@ -427,5 +431,35 @@ namespace GeekDesk.Control.UserControls.PannelCard
MenuListBox.SelectedIndex = index;
}
}
private void Menu_PreviewDragLeave(object sender, DragEventArgs e)
{
MyPoptip.IsOpen = false;
}
private void Menu_PreviewDragEnter(object sender, DragEventArgs e)
{
MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
MyPoptipContent.Text = "移动至:" + mi.MenuName;
MyPoptip.VerticalOffset = 30;
MyPoptip.IsOpen = true;
}
private void Menu_MouseLeave(object sender, MouseEventArgs e)
{
MyPoptip.IsOpen = false;
}
private void Menu_Drop(object sender, DragEventArgs e)
{
MyPoptip.IsOpen = false;
MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
IconInfo iconInfo = (IconInfo)e.Data.GetData(typeof(IconInfo));
appData.MenuList[MenuListBox.SelectedIndex].IconList.Remove(iconInfo);
appData.MenuList[MenuListBox.Items.IndexOf(mi)].IconList.Add(iconInfo);
}
}
}