Browse Source

暂时可简单使用

liufei 4 years ago
parent
commit
ef7cb465a1

+ 1 - 0
App.xaml

@@ -11,6 +11,7 @@
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
                 <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
+                <ResourceDictionary Source="d:\workspace\workspace-vs\geekdesk\resource\dictionary\gemetrydictionary.xaml"/>
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
   </Application.Resources>

+ 15 - 16
GeekDesk.csproj

@@ -41,29 +41,14 @@
     <Reference Include="CommonServiceLocator, Version=2.0.6.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>packages\CommonServiceLocator.2.0.6\lib\net45\CommonServiceLocator.dll</HintPath>
     </Reference>
-    <Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
-      <HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
-    </Reference>
-    <Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
-      <HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
-    </Reference>
-    <Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
-      <HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
-    </Reference>
     <Reference Include="HandyControl, Version=3.1.0.0, Culture=neutral, PublicKeyToken=45be8712787a1e5b, processorArchitecture=MSIL">
       <HintPath>packages\HandyControl.3.1.0\lib\net452\HandyControl.dll</HintPath>
     </Reference>
-    <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
-      <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>packages\System.Drawing.Common.5.0.2\lib\net461\System.Drawing.Common.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
+      <HintPath>packages\System.Drawing.Common.6.0.0-preview.3.21201.4\lib\net461\System.Drawing.Common.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />
@@ -96,6 +81,7 @@
     <Compile Include="Util\ConsoleManager.cs" />
     <Compile Include="Util\DragAdorner.cs" />
     <Compile Include="Util\FileIcon.cs" />
+    <Compile Include="Util\HotKey.cs" />
     <Compile Include="Util\ListViewDragDropManager.cs" />
     <Compile Include="Util\MenuWidthConvert.cs" />
     <Compile Include="Util\MouseUtilities.cs" />
@@ -117,6 +103,10 @@
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="Resource\Dictionary\GemetryDictionary.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs">
@@ -141,9 +131,18 @@
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
+    <None Include="Resource\DefaultIconfont\iconfont.json" />
+    <Resource Include="Resource\DefaultIconfont\iconfont.ttf" />
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="Resource\DefaultIconfont\iconfont.svg" />
+    <Resource Include="Resource\Image\Ico.png" />
+    <Resource Include="Resource\Image\Ico.ico" />
+    <Resource Include="Resource\Image\WindowLogo.png" />
+  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

File diff suppressed because it is too large
+ 59 - 64
MainWindow.xaml


+ 65 - 71
MainWindow.xaml.cs

@@ -27,43 +27,32 @@ namespace GeekDesk
         {
             InitializeComponent();
             loadData();
-            List<string> menuList = new List<string>();
-
-            Dictionary<string, List<IconInfo>> iconMap = new Dictionary<string, List<IconInfo>>();
-
-
-
             //this.DataContext = mainModel;
             //menu.Items = mainModel;
             //System.Diagnostics.Process.Start(@"D:\SoftWare\WeGame\wegame.exe");
             this.Loaded += Window_Loaded;
             this.SizeChanged += MainWindow_Resize;
+            this.Topmost = true;
         }
 
         private void loadData()
         {
             this.DataContext = appData;
-            //menus.ItemsSource = appData.MenuList;
-            appData.MenuList.Add(new MenuInfo() { MenuName = "test1", MenuId = "1", MenuEdit = (int)Visibility.Collapsed });
-            this.Width = appData.AppConfig.WindowWidth;
-            this.Height = appData.AppConfig.WindowHeight;
-
-
-            ObservableCollection<IconInfo> iconList;
-            if (appData.IconMap.ContainsKey("1"))
-            {
-                iconList = appData.IconMap["1"];
-            }
-            else
+            if (appData.MenuList.Count == 0)
             {
-                iconList = new ObservableCollection<IconInfo>();
-                appData.IconMap.Add("1", iconList);
+                appData.MenuList.Add(new MenuInfo() { MenuName = "NewGouop", MenuId = System.Guid.NewGuid().ToString(), MenuEdit = (int)Visibility.Collapsed});
             }
-            icons.ItemsSource = iconList;
-
+            //窗体大小
+            this.Width = appData.AppConfig.WindowWidth;
+            this.Height = appData.AppConfig.WindowHeight;
+            //选中 菜单
+            menus.SelectedIndex = appData.AppConfig.SelectedMenuIndex;
+            //图标数据
+            icons.ItemsSource = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
         }
 
 
+        #region 图标拖动
         DelegateCommand<int[]> _swap;
         public DelegateCommand<int[]> SwapCommand
         {
@@ -94,7 +83,6 @@ namespace GeekDesk
         }
         DelegateCommand<int[]> _swap2;
 
-
         public DelegateCommand<int[]> SwapCommand2
         {
             get
@@ -126,7 +114,7 @@ namespace GeekDesk
                 return _swap2;
             }
         }
-
+        #endregion 图标拖动
 
 
         private void Wrap_Drop(object sender, DragEventArgs e)
@@ -144,18 +132,7 @@ namespace GeekDesk
                     iconInfo.Path = path;
                     iconInfo.BitmapImage = bi;
                     iconInfo.Name = Path.GetFileNameWithoutExtension(path);
-                    ObservableCollection<IconInfo> iconList;
-                    if (appData.IconMap.ContainsKey("1"))
-                    {
-                        iconList = appData.IconMap["1"];
-                    }
-                    else
-                    {
-                        iconList = new ObservableCollection<IconInfo>();
-                        appData.IconMap.Add("1", iconList);
-                    }
-                    iconList.Add(iconInfo);
-                    icons.ItemsSource = iconList;
+                    appData.MenuList[menus.SelectedIndex].IconList.Add(iconInfo);
                     CommonCode.SaveAppData(appData);
 
                 }
@@ -166,15 +143,15 @@ namespace GeekDesk
                 }
             }
             icons.Items.Refresh();
-
-
-
         }
 
         //菜单点击事件
-        private void menuClick(object sender, MouseButtonEventArgs e)
+        private void MenuClick(object sender, SelectionChangedEventArgs e)
         {
-
+            //设置对应菜单的图标列表
+            icons.ItemsSource = appData.MenuList[menus.SelectedIndex].IconList;
+            appData.AppConfig.SelectedMenuIndex = menus.SelectedIndex;
+            CommonCode.SaveAppData(appData);
         }
 
 
@@ -184,7 +161,7 @@ namespace GeekDesk
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void dataClick(object sender, MouseButtonEventArgs e)
+        private void IconClick(object sender, MouseButtonEventArgs e)
         {
             IconInfo icon = (IconInfo)((StackPanel)sender).Tag;
             System.Diagnostics.Process.Start(icon.Path);
@@ -197,30 +174,26 @@ namespace GeekDesk
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void data_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        private void IconSelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             if (icons.SelectedIndex != -1) icons.SelectedIndex = -1;
         }
 
-        #region Window_Loaded
         void Window_Loaded(object sender, RoutedEventArgs e)
         {
-            //this.menus.Items.Add(new ViewModel.Menu() { menu = "test1" });
-            //this.menus.Items.Add(new ViewModel.Menu() { menu = "test2" });
-            //this.menus.Items.Add(new ViewModel.Menu() { menu = "test3" });
+            //加载完毕注册热键
+            Hotkey.Regist(this, HotkeyModifiers.MOD_CONTROL, Key.Y, ()=>
+            {
+                if (this.Visibility == Visibility.Collapsed)
+                {
+                    this.Visibility = Visibility.Visible;
+                } else
+                {
+                    this.Visibility = Visibility.Collapsed;
+                }
+            });
         }
-        #endregion // Window_Loaded
-
-        //#region Window_Closing
-        //void Window_Closing(object sender, CancelEventArgs e)
-        //{
-        //    Rect rect = this.RestoreBounds;
-        //    AppConfig config = this.DataContext as AppConfig;
-        //    config.WindowWidth = rect.Width;
-        //    config.WindowHeight = rect.Height;
-        //    CommonCode.SaveAppConfig(config);
-        //}
-        //#endregion // Window_Closing
+
 
         void MainWindow_Resize(object sender, System.EventArgs e)
         {
@@ -234,13 +207,6 @@ namespace GeekDesk
         }
 
 
-
-
-        private void leftCard_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
-        {
-
-        }
-
         /// <summary>
         /// 删除菜单
         /// </summary>
@@ -253,11 +219,12 @@ namespace GeekDesk
             CommonCode.SaveAppData(appData);
         }
 
-        private void StackPanel_MouseMove(object sender, MouseEventArgs e)
+        private void DragMove(object sender, MouseEventArgs e)
         {
-            UIElementCollection childs = ((StackPanel)sender).Children;
-            IEnumerator iEnumerator = childs.GetEnumerator();
-            //((Image)iEnumerator.Current).Style;
+            if (e.LeftButton == MouseButtonState.Pressed)
+            {
+                this.DragMove();
+            }
         }
 
         /// <summary>
@@ -346,11 +313,38 @@ namespace GeekDesk
         /// <param name="e"></param>
         private void CreateMenu(object sender, RoutedEventArgs e)
         {
-            appData.MenuList.Add(new MenuInfo() { MenuEdit = (int)Visibility.Collapsed, MenuId = "zz", MenuName = "NewGouop" });
+            appData.MenuList.Add(new MenuInfo() { MenuEdit = (int)Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewGouop" });
             menus.SelectedIndex = appData.MenuList.Count - 1;
             //appData.MenuList[appData.MenuList.Count - 1].MenuEdit = (int)Visibility.Visible;
             CommonCode.SaveAppData(appData);
         }
+
+        /// <summary>
+        /// 关闭按钮单击事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void CloseButtonClick(object sender, RoutedEventArgs e)
+        {
+            this.Visibility = Visibility.Collapsed;
+        }
+
+        /// <summary>
+        /// 图片图标单击事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void NotifyIcon_Click(object sender, RoutedEventArgs e)
+        {
+            if (this.Visibility == Visibility.Collapsed)
+            {
+                this.Visibility = Visibility.Visible;
+            } else
+            {
+                this.Visibility = Visibility.Collapsed;
+            }
+        }
+
     }
 
 

+ 219 - 0
Resource/DefaultIconfont/iconfont.json

@@ -0,0 +1,219 @@
+{
+  "id": "2491374",
+  "name": "GeekIcon",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon-",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "13160269",
+      "name": "会话",
+      "font_class": "huihua",
+      "unicode": "e614",
+      "unicode_decimal": 58900
+    },
+    {
+      "icon_id": "14236852",
+      "name": "文件夹",
+      "font_class": "wenjianjia1",
+      "unicode": "e62e",
+      "unicode_decimal": 58926
+    },
+    {
+      "icon_id": "15416685",
+      "name": "文件夹",
+      "font_class": "wenjianjia2",
+      "unicode": "e606",
+      "unicode_decimal": 58886
+    },
+    {
+      "icon_id": "15711148",
+      "name": "系统",
+      "font_class": "xitong3",
+      "unicode": "e621",
+      "unicode_decimal": 58913
+    },
+    {
+      "icon_id": "18058019",
+      "name": "游戏",
+      "font_class": "game",
+      "unicode": "e681",
+      "unicode_decimal": 59009
+    },
+    {
+      "icon_id": "19977025",
+      "name": "系统",
+      "font_class": "xitong4",
+      "unicode": "e63e",
+      "unicode_decimal": 58942
+    },
+    {
+      "icon_id": "20017778",
+      "name": "人-翻墙",
+      "font_class": "ren-fanqiang",
+      "unicode": "e88c",
+      "unicode_decimal": 59532
+    },
+    {
+      "icon_id": "1250",
+      "name": "其它",
+      "font_class": "qita",
+      "unicode": "e600",
+      "unicode_decimal": 58880
+    },
+    {
+      "icon_id": "397886",
+      "name": "开发,代码",
+      "font_class": "kaifa",
+      "unicode": "e618",
+      "unicode_decimal": 58904
+    },
+    {
+      "icon_id": "511314",
+      "name": "打开会话",
+      "font_class": "dakaihuihua",
+      "unicode": "e64a",
+      "unicode_decimal": 58954
+    },
+    {
+      "icon_id": "791886",
+      "name": "会话",
+      "font_class": "huihua-copy",
+      "unicode": "e647",
+      "unicode_decimal": 58951
+    },
+    {
+      "icon_id": "1033987",
+      "name": "游戏",
+      "font_class": "iconfontyouxihudong",
+      "unicode": "e636",
+      "unicode_decimal": 58934
+    },
+    {
+      "icon_id": "1119109",
+      "name": "系统",
+      "font_class": "xitong",
+      "unicode": "e601",
+      "unicode_decimal": 58881
+    },
+    {
+      "icon_id": "1137788",
+      "name": "系统",
+      "font_class": "xitong1",
+      "unicode": "e67c",
+      "unicode_decimal": 59004
+    },
+    {
+      "icon_id": "1159887",
+      "name": "下载",
+      "font_class": "xiazai",
+      "unicode": "e617",
+      "unicode_decimal": 58903
+    },
+    {
+      "icon_id": "1629872",
+      "name": "文件夹",
+      "font_class": "icon-test",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    },
+    {
+      "icon_id": "2006733",
+      "name": "会话",
+      "font_class": "xinxi",
+      "unicode": "e640",
+      "unicode_decimal": 58944
+    },
+    {
+      "icon_id": "2418266",
+      "name": "下载",
+      "font_class": "xiazai1",
+      "unicode": "e674",
+      "unicode_decimal": 58996
+    },
+    {
+      "icon_id": "2742683",
+      "name": "游戏",
+      "font_class": "youxi",
+      "unicode": "e680",
+      "unicode_decimal": 59008
+    },
+    {
+      "icon_id": "3879214",
+      "name": "网络",
+      "font_class": "wangluo",
+      "unicode": "e611",
+      "unicode_decimal": 58897
+    },
+    {
+      "icon_id": "3903356",
+      "name": "开发",
+      "font_class": "kaifa-",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "7055665",
+      "name": "网络",
+      "font_class": "wangluo1",
+      "unicode": "e735",
+      "unicode_decimal": 59189
+    },
+    {
+      "icon_id": "8802631",
+      "name": "系统",
+      "font_class": "xitong2",
+      "unicode": "e648",
+      "unicode_decimal": 58952
+    },
+    {
+      "icon_id": "9712640",
+      "name": "下载",
+      "font_class": "xiazai2",
+      "unicode": "e6af",
+      "unicode_decimal": 59055
+    },
+    {
+      "icon_id": "9783461",
+      "name": "开发设计",
+      "font_class": "kaifasheji",
+      "unicode": "e613",
+      "unicode_decimal": 58899
+    },
+    {
+      "icon_id": "9924353",
+      "name": "其它",
+      "font_class": "qita1",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    },
+    {
+      "icon_id": "9974441",
+      "name": "网络",
+      "font_class": "wangluo2",
+      "unicode": "e70b",
+      "unicode_decimal": 59147
+    },
+    {
+      "icon_id": "10294636",
+      "name": "开发",
+      "font_class": "developer",
+      "unicode": "e651",
+      "unicode_decimal": 58961
+    },
+    {
+      "icon_id": "11121465",
+      "name": "开发套件",
+      "font_class": "kaifataojian",
+      "unicode": "e63a",
+      "unicode_decimal": 58938
+    },
+    {
+      "icon_id": "11759969",
+      "name": "文件夹",
+      "font_class": "wenjianjia",
+      "unicode": "e7c2",
+      "unicode_decimal": 59330
+    }
+  ]
+}

File diff suppressed because it is too large
+ 40 - 0
Resource/DefaultIconfont/iconfont.svg


BIN
Resource/DefaultIconfont/iconfont.ttf


File diff suppressed because it is too large
+ 6 - 0
Resource/Dictionary/GemetryDictionary.xaml


BIN
Resource/Image/Ico.ico


BIN
Resource/Image/Ico.png


BIN
Resource/Image/WindowLogo.png


+ 89 - 0
Util/HotKey.cs

@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Windows;
+using System.Windows.Input;
+using System.Windows.Interop;
+
+namespace GeekDesk.Util
+{
+
+    class Hotkey
+    {
+        #region 系统api
+        [DllImport("user32.dll")]
+        [return: MarshalAs(UnmanagedType.Bool)]
+        static extern bool RegisterHotKey(IntPtr hWnd, int id, HotkeyModifiers fsModifiers, uint vk);
+
+        [DllImport("user32.dll")]
+        static extern bool UnregisterHotKey(IntPtr hWnd, int id);
+        #endregion
+
+        /// <summary>
+        /// 注册快捷键
+        /// </summary>
+        /// <param name="window">持有快捷键窗口</param>
+        /// <param name="fsModifiers">组合键</param>
+        /// <param name="key">快捷键</param>
+        /// <param name="callBack">回调函数</param>
+        public static bool Regist(Window window, HotkeyModifiers fsModifiers, Key key, HotKeyCallBackHanlder callBack)
+        {
+            var hwnd = new WindowInteropHelper(window).Handle;
+            var _hwndSource = HwndSource.FromHwnd(hwnd);
+            _hwndSource.AddHook(WndProc);
+
+            int id = keyid++;
+
+            var vk = KeyInterop.VirtualKeyFromKey(key);
+            keymap[id] = callBack;
+
+            return RegisterHotKey(hwnd, id, fsModifiers, (uint)vk);
+        }
+
+        /// <summary>
+        /// 快捷键消息处理
+        /// </summary>
+        static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
+        {
+            if (msg == WM_HOTKEY)
+            {
+                int id = wParam.ToInt32();
+                if (keymap.TryGetValue(id, out var callback))
+                {
+                    callback();
+                }
+            }
+            return IntPtr.Zero;
+        }
+
+        /// <summary>
+        /// 注销快捷键
+        /// </summary>
+        /// <param name="hWnd">持有快捷键窗口的句柄</param>
+        /// <param name="callBack">回调函数</param>
+        public static void UnRegist(IntPtr hWnd, HotKeyCallBackHanlder callBack)
+        {
+            foreach (KeyValuePair<int, HotKeyCallBackHanlder> var in keymap)
+            {
+                if (var.Value == callBack)
+                    UnregisterHotKey(hWnd, var.Key);
+            }
+        }
+
+
+        const int WM_HOTKEY = 0x312;
+        static int keyid = 10;
+        static Dictionary<int, HotKeyCallBackHanlder> keymap = new Dictionary<int, HotKeyCallBackHanlder>();
+
+        public delegate void HotKeyCallBackHanlder();
+    }
+
+    enum HotkeyModifiers
+    {
+        MOD_ALT = 0x1,
+        MOD_CONTROL = 0x2,
+        MOD_SHIFT = 0x4,
+        MOD_WIN = 0x8
+    }
+
+}

+ 14 - 0
ViewModel/AppConfig.cs

@@ -14,10 +14,24 @@ namespace GeekDesk.ViewModel
         private double windowWidth = (double)DefaultConstant.WINDOW_WIDTH;  //窗口宽度
         private double windowHeight = (double)DefaultConstant.WINDOW_HEIGHT; //窗口高度
         private double menuCardWidth = (double)DefaultConstant.MENU_CARD_WIDHT;//菜单栏宽度
+        private int selectedMenuIndex = 0;  //上次选中菜单索引
 
 
 
         #region GetSet
+        public int SelectedMenuIndex
+        {
+            get
+            {
+                return selectedMenuIndex;
+            }
+            set
+            {
+                selectedMenuIndex = value;
+                OnPropertyChanged("SelectedMenuIndex");
+            }
+        }
+
         public int MenuSortType
         {
             get

+ 0 - 13
ViewModel/AppData.cs

@@ -9,7 +9,6 @@ namespace GeekDesk.ViewModel
     class AppData : INotifyPropertyChanged
     {
         private ObservableCollection<MenuInfo> menuList = new ObservableCollection<MenuInfo>();
-        private Dictionary<string, ObservableCollection<IconInfo>> iconMap = new Dictionary<string, ObservableCollection<IconInfo>>();
         private AppConfig appConfig = new AppConfig();
 
         public ObservableCollection<MenuInfo> MenuList
@@ -25,18 +24,6 @@ namespace GeekDesk.ViewModel
             }
         }
 
-        public Dictionary<string, ObservableCollection<IconInfo>> IconMap
-        {
-            get
-            {
-                return iconMap;
-            }
-            set
-            {
-                iconMap = value;
-                OnPropertyChanged("IconMap");
-            }
-        }
 
         public AppConfig AppConfig
         {

+ 15 - 0
ViewModel/IconInfo.cs

@@ -116,6 +116,21 @@ namespace GeekDesk.ViewModel
             }
         }
 
+        public int ImageHeight
+        {
+            get
+            {
+                return imageHeight;
+            }
+            set
+            {
+                imageHeight = value;
+                OnPropertyChanged("ImageHeight");
+            }
+        }
+
+
+
 
 
         [field: NonSerializedAttribute()]

+ 23 - 6
ViewModel/MenuInfo.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Linq;
 using System.Text;
@@ -12,17 +13,13 @@ namespace GeekDesk.ViewModel
     [Serializable]
     class MenuInfo : INotifyPropertyChanged
     {
-        [field: NonSerializedAttribute()]
-        public event PropertyChangedEventHandler PropertyChanged;
-        private void OnPropertyChanged(string propertyName)
-        {
-            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
-        }
+       
 
         private string menuName;
         private string menuId;
         private int menuEdit = (int)Visibility.Collapsed;
         private int notMenuEdit = (int)Visibility.Visible;
+        private ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
 
         public string MenuName
         {
@@ -82,5 +79,25 @@ namespace GeekDesk.ViewModel
                 OnPropertyChanged("NotMenuEdit");
             }
         }
+
+        public ObservableCollection<IconInfo> IconList
+        {
+            get
+            {
+                return iconList;
+            }
+            set
+            {
+                iconList = value;
+                OnPropertyChanged("IconList");
+            }
+        }
+
+        [field: NonSerializedAttribute()]
+        public event PropertyChangedEventHandler PropertyChanged;
+        private void OnPropertyChanged(string propertyName)
+        {
+            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+        }
     }
 }

+ 1 - 4
packages.config

@@ -2,8 +2,5 @@
 <packages>
   <package id="CommonServiceLocator" version="2.0.6" targetFramework="net452" requireReinstallation="true" />
   <package id="HandyControl" version="3.1.0" targetFramework="net452" requireReinstallation="true" />
-  <package id="MvvmLight" version="5.4.1.1" targetFramework="net452" />
-  <package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
-  <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
-  <package id="System.Drawing.Common" version="5.0.2" targetFramework="net472" />
+  <package id="System.Drawing.Common" version="6.0.0-preview.3.21201.4" targetFramework="net472" />
 </packages>

Some files were not shown because too many files changed in this diff