diff --git a/App.xaml b/App.xaml
index 53e826a..e7f6a79 100644
--- a/App.xaml
+++ b/App.xaml
@@ -11,6 +11,7 @@
+
diff --git a/GeekDesk.csproj b/GeekDesk.csproj
index 608ad9d..9a5f64b 100644
--- a/GeekDesk.csproj
+++ b/GeekDesk.csproj
@@ -41,29 +41,14 @@
packages\CommonServiceLocator.2.0.6\lib\net45\CommonServiceLocator.dll
-
- packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll
-
-
- packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll
-
-
- packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll
-
packages\HandyControl.3.1.0\lib\net452\HandyControl.dll
-
- packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
-
- packages\System.Drawing.Common.5.0.2\lib\net461\System.Drawing.Common.dll
-
-
- packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll
+ packages\System.Drawing.Common.6.0.0-preview.3.21201.4\lib\net461\System.Drawing.Common.dll
@@ -96,6 +81,7 @@
+
@@ -117,6 +103,10 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
@@ -141,9 +131,18 @@
SettingsSingleFileGenerator
Settings.Designer.cs
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 6441e16..f43a993 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -9,33 +9,10 @@
xmlns:util="clr-namespace:GeekDesk.Util"
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel" x:Name="window"
xmlns:hc="https://handyorg.github.io/handycontrol"
- Title="MainWindow" Height="500" Width="600">
+ Title="MainWindow" Height="500" Width="600"
+ >
-
-
-
-
-
-
-
-
-
@@ -124,25 +94,49 @@
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
-
@@ -150,7 +144,9 @@
-
+
@@ -185,24 +181,43 @@
Tag="{Binding}"
IsVisibleChanged="MenuEditWhenVisibilityChanged"
Visibility="{Binding Path=MenuEdit, Converter={StaticResource VisibilityConvert}}"/>
-
+
+
+
+
+
+
-
+
@@ -213,34 +228,30 @@
-
-
-
-
-
+
+
+
-
-
-
-
+
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index cd0c275..ff717ba 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -27,43 +27,32 @@ namespace GeekDesk
{
InitializeComponent();
loadData();
- List menuList = new List();
-
- Dictionary> iconMap = new Dictionary>();
-
-
-
//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 });
+ if (appData.MenuList.Count == 0)
+ {
+ appData.MenuList.Add(new MenuInfo() { MenuName = "NewGouop", MenuId = System.Guid.NewGuid().ToString(), MenuEdit = (int)Visibility.Collapsed});
+ }
+ //窗体大小
this.Width = appData.AppConfig.WindowWidth;
this.Height = appData.AppConfig.WindowHeight;
-
-
- ObservableCollection iconList;
- if (appData.IconMap.ContainsKey("1"))
- {
- iconList = appData.IconMap["1"];
- }
- else
- {
- iconList = new ObservableCollection();
- appData.IconMap.Add("1", iconList);
- }
- icons.ItemsSource = iconList;
-
+ //选中 菜单
+ menus.SelectedIndex = appData.AppConfig.SelectedMenuIndex;
+ //图标数据
+ icons.ItemsSource = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
}
+ #region 图标拖动
DelegateCommand _swap;
public DelegateCommand SwapCommand
{
@@ -94,7 +83,6 @@ namespace GeekDesk
}
DelegateCommand _swap2;
-
public DelegateCommand 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 iconList;
- if (appData.IconMap.ContainsKey("1"))
- {
- iconList = appData.IconMap["1"];
- }
- else
- {
- iconList = new ObservableCollection();
- 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
///
///
///
- 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
///
///
///
- 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)
- {
-
- }
-
///
/// 删除菜单
///
@@ -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();
+ }
}
///
@@ -346,11 +313,38 @@ namespace GeekDesk
///
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);
}
+
+ ///
+ /// 关闭按钮单击事件
+ ///
+ ///
+ ///
+ private void CloseButtonClick(object sender, RoutedEventArgs e)
+ {
+ this.Visibility = Visibility.Collapsed;
+ }
+
+ ///
+ /// 图片图标单击事件
+ ///
+ ///
+ ///
+ private void NotifyIcon_Click(object sender, RoutedEventArgs e)
+ {
+ if (this.Visibility == Visibility.Collapsed)
+ {
+ this.Visibility = Visibility.Visible;
+ } else
+ {
+ this.Visibility = Visibility.Collapsed;
+ }
+ }
+
}
diff --git a/Resource/DefaultIconfont/iconfont.json b/Resource/DefaultIconfont/iconfont.json
new file mode 100644
index 0000000..f77c09e
--- /dev/null
+++ b/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
+ }
+ ]
+}
diff --git a/Resource/DefaultIconfont/iconfont.svg b/Resource/DefaultIconfont/iconfont.svg
new file mode 100644
index 0000000..e7a24e7
--- /dev/null
+++ b/Resource/DefaultIconfont/iconfont.svg
@@ -0,0 +1,116 @@
+
+
+
+
diff --git a/Resource/DefaultIconfont/iconfont.ttf b/Resource/DefaultIconfont/iconfont.ttf
new file mode 100644
index 0000000..d223520
Binary files /dev/null and b/Resource/DefaultIconfont/iconfont.ttf differ
diff --git a/Resource/Dictionary/GemetryDictionary.xaml b/Resource/Dictionary/GemetryDictionary.xaml
new file mode 100644
index 0000000..023410d
--- /dev/null
+++ b/Resource/Dictionary/GemetryDictionary.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+ M890.368 334.336c9.216 13.312 18.432 26.624 27.648 40.448 0.512 0 0.512 0.512 1.024 0.512l32.256-52.224c16.896-25.088 35.328-45.056 45.568-78.336 19.456-64.512-26.624-112.128-87.04-110.592-4.096 0.512-8.704 1.536-12.8 2.048-14.848 4.096-29.696 13.312-37.888 24.064-7.168 8.704-13.824 17.92-18.432 29.184-11.264 28.16-2.56 61.44 9.728 80.896 12.8 21.504 26.624 43.008 39.936 64zM881.152 209.92c5.632-17.92 17.408-21.504 34.304-28.16 53.248-1.024 54.272 74.752 5.12 81.92-25.088 3.584-47.616-28.16-39.424-53.76zM938.496 631.808c-46.592-30.72-93.696-60.928-140.288-91.648-15.872-10.752-32.256-22.016-48.128-32.768l-95.232-52.224c-16.896-9.728-36.864-18.432-50.176-31.744-0.512 0-0.512-0.512-1.024-0.512 63.488-13.312 129.536-13.824 196.096-25.088 34.304-4.096 68.096-7.68 102.4-11.776v-0.512c-5.12-7.168-19.968-27.136-27.648-30.72-8.704 0.512-17.408 1.536-25.6 2.048-30.72 2.048-61.952 3.584-92.672 5.632-24.064 3.584-48.64 0.512-74.24 4.608-71.68 6.656-143.872 13.312-215.552 19.456 32.256 25.088 65.024 50.176 97.28 74.752 34.816 23.04 72.192 41.472 105.984 65.536 43.008 33.28 86.016 66.56 128.512 100.352 0.512 0.512 0.512 1.024 1.024 1.536-103.424 6.656-206.848 13.312-309.76 19.456-20.992 1.024-41.984 2.048-62.464 2.56-25.6 4.096-49.152 5.12-72.704 9.728-11.264 1.536-22.528 3.584-34.304 5.12l-101.376 170.496c-0.512 0.512-0.512 1.024-1.024 1.536 114.688-25.088 233.472-44.032 349.696-70.144l188.928-33.792c89.088-15.36 178.688-30.72 267.776-46.08v-0.512c-28.672-17.92-56.832-36.864-85.504-55.296zM270.848 678.912c33.792-47.104 65.536-84.48 85.504-147.968 44.544-141.312-45.568-257.024-183.296-254.464-10.752 4.096-26.624 3.072-37.376 6.144-32.256 9.728-62.976 29.184-81.92 52.736-16.384 20.48-31.232 40.96-41.984 67.584C-12.8 465.92 5.12 532.48 32.768 577.536c31.744 51.712 64 102.4 98.304 151.552 18.432 27.136 36.352 54.272 54.784 80.896 0.512 0.512 1.024 0.512 1.536 1.024 11.264-18.432 22.528-36.864 34.304-55.296 16.384-26.112 31.744-52.224 49.152-76.8z m-166.912-89.6V387.584h68.096c19.968 0 35.84 1.536 48.128 4.096 12.288 3.072 23.552 7.68 33.28 14.336 14.336 9.728 25.6 21.504 33.792 36.352s12.288 30.208 12.288 46.592c0 15.872-3.072 30.208-9.216 44.032-6.144 13.312-15.36 25.088-26.624 35.328-8.704 7.168-18.432 12.288-29.696 15.872s-24.064 5.632-36.864 5.632l-93.184-0.512z
+ M223.232 433.664c-10.24-12.8-24.576-19.456-43.008-19.456h-19.456v147.456h19.456c18.432 0 33.28-6.656 43.008-19.456s15.36-31.232 15.36-54.784c0-22.528-5.12-40.96-15.36-53.76z
+
+
+
\ No newline at end of file
diff --git a/Resource/Image/Ico.ico b/Resource/Image/Ico.ico
new file mode 100644
index 0000000..a9600c1
Binary files /dev/null and b/Resource/Image/Ico.ico differ
diff --git a/Resource/Image/Ico.png b/Resource/Image/Ico.png
new file mode 100644
index 0000000..6551b7d
Binary files /dev/null and b/Resource/Image/Ico.png differ
diff --git a/Resource/Image/WindowLogo.png b/Resource/Image/WindowLogo.png
new file mode 100644
index 0000000..7c17f9b
Binary files /dev/null and b/Resource/Image/WindowLogo.png differ
diff --git a/Util/HotKey.cs b/Util/HotKey.cs
new file mode 100644
index 0000000..34f51f2
--- /dev/null
+++ b/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
+
+ ///
+ /// 注册快捷键
+ ///
+ /// 持有快捷键窗口
+ /// 组合键
+ /// 快捷键
+ /// 回调函数
+ 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);
+ }
+
+ ///
+ /// 快捷键消息处理
+ ///
+ 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;
+ }
+
+ ///
+ /// 注销快捷键
+ ///
+ /// 持有快捷键窗口的句柄
+ /// 回调函数
+ public static void UnRegist(IntPtr hWnd, HotKeyCallBackHanlder callBack)
+ {
+ foreach (KeyValuePair var in keymap)
+ {
+ if (var.Value == callBack)
+ UnregisterHotKey(hWnd, var.Key);
+ }
+ }
+
+
+ const int WM_HOTKEY = 0x312;
+ static int keyid = 10;
+ static Dictionary keymap = new Dictionary();
+
+ public delegate void HotKeyCallBackHanlder();
+ }
+
+ enum HotkeyModifiers
+ {
+ MOD_ALT = 0x1,
+ MOD_CONTROL = 0x2,
+ MOD_SHIFT = 0x4,
+ MOD_WIN = 0x8
+ }
+
+}
diff --git a/ViewModel/AppConfig.cs b/ViewModel/AppConfig.cs
index c164b0f..da63785 100644
--- a/ViewModel/AppConfig.cs
+++ b/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
diff --git a/ViewModel/AppData.cs b/ViewModel/AppData.cs
index f9d14b4..3f76f1a 100644
--- a/ViewModel/AppData.cs
+++ b/ViewModel/AppData.cs
@@ -9,7 +9,6 @@ namespace GeekDesk.ViewModel
class AppData : INotifyPropertyChanged
{
private ObservableCollection menuList = new ObservableCollection();
- private Dictionary> iconMap = new Dictionary>();
private AppConfig appConfig = new AppConfig();
public ObservableCollection MenuList
@@ -25,18 +24,6 @@ namespace GeekDesk.ViewModel
}
}
- public Dictionary> IconMap
- {
- get
- {
- return iconMap;
- }
- set
- {
- iconMap = value;
- OnPropertyChanged("IconMap");
- }
- }
public AppConfig AppConfig
{
diff --git a/ViewModel/IconInfo.cs b/ViewModel/IconInfo.cs
index 6341a53..aad1c06 100644
--- a/ViewModel/IconInfo.cs
+++ b/ViewModel/IconInfo.cs
@@ -116,6 +116,21 @@ namespace GeekDesk.ViewModel
}
}
+ public int ImageHeight
+ {
+ get
+ {
+ return imageHeight;
+ }
+ set
+ {
+ imageHeight = value;
+ OnPropertyChanged("ImageHeight");
+ }
+ }
+
+
+
[field: NonSerializedAttribute()]
diff --git a/ViewModel/MenuInfo.cs b/ViewModel/MenuInfo.cs
index 8564f30..ad3acf4 100644
--- a/ViewModel/MenuInfo.cs
+++ b/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 iconList = new ObservableCollection();
public string MenuName
{
@@ -82,5 +79,25 @@ namespace GeekDesk.ViewModel
OnPropertyChanged("NotMenuEdit");
}
}
+
+ public ObservableCollection 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));
+ }
}
}
diff --git a/packages.config b/packages.config
index a705136..eee72c4 100644
--- a/packages.config
+++ b/packages.config
@@ -2,8 +2,5 @@
-
-
-
-
+
\ No newline at end of file