AppConfig.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  1. 
  2. using GeekDesk.Constant;
  3. using GeekDesk.Util;
  4. using GeekDesk.ViewModel.Temp;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.ObjectModel;
  8. using System.ComponentModel;
  9. using System.Windows;
  10. using System.Windows.Input;
  11. using System.Windows.Media.Imaging;
  12. using static GeekDesk.Util.GlobalHotKey;
  13. /// <summary>
  14. /// 程序设置
  15. /// </summary>
  16. namespace GeekDesk.ViewModel
  17. {
  18. [Serializable]
  19. public class AppConfig : INotifyPropertyChanged
  20. {
  21. private SortType menuSortType = SortType.CUSTOM; //菜单排序类型
  22. private SortType iconSortType = SortType.CUSTOM; //图表排序类型
  23. private double windowWidth = (double)CommonEnum.WINDOW_WIDTH; //窗口宽度
  24. private double windowHeight = (double)CommonEnum.WINDOW_HEIGHT; //窗口高度
  25. private double menuCardWidth = (double)CommonEnum.MENU_CARD_WIDHT;//菜单栏宽度
  26. private int selectedMenuIndex = 0; //上次选中菜单索引
  27. private bool followMouse = true; //面板跟随鼠标 默认是
  28. private Visibility configIconVisible = Visibility.Visible; // 设置按钮是否显示
  29. private Visibility titleLogoVisible = Visibility.Visible; // 标题logo是否显示
  30. private AppHideType appHideType = AppHideType.START_EXE; //面板关闭方式 (默认启动程序后)
  31. private bool startedShowPanel = true; //启动时是否显示主面板 默认显示
  32. [field: NonSerialized]
  33. private BitmapImage bitmapImage; //位图
  34. private byte[] imageByteArr; //背景图片 byte数组
  35. private string bacImgName = "系统默认";
  36. private int cardOpacity = 10; //默认0.1的不透明度 此处显示数值 * 100
  37. private int bgOpacity = 100; // 背景图片不透明度 此处显示数值 * 100
  38. private int pannelOpacity = 100; //主面板不透明度 此处显示数值 * 100
  39. private int pannelCornerRadius = 4; //面板圆角 默认4
  40. [field: NonSerialized]
  41. private ObservableCollection<IconInfo> selectedMenuIcons;
  42. private string hotkeyStr = "Ctrl + Q"; //默认启动面板快捷键
  43. private HotkeyModifiers hotkeyModifiers = HotkeyModifiers.MOD_CONTROL; //默认启动面板快捷键
  44. private Key hotkey = Key.Q; //默认启动面板快捷键
  45. private string toDoHotkeyStr = "Ctrl + Shift + Q"; //待办任务快捷键
  46. private HotkeyModifiers toDoHotkeyModifiers; //待办任务快捷键
  47. private Key toDoHotkey = Key.Q; //待办任务快捷键
  48. private string colorPickerHotkeyStr = ""; //拾色器快捷键
  49. private HotkeyModifiers colorPickerHotkeyModifiers; //拾色器快捷键
  50. private Key colorPickerHotkey; //拾色器快捷键
  51. private string customIconUrl; //自定义图标url
  52. private string customIconJsonUrl; //自定义图标json信息url
  53. private bool blurEffect = false; //毛玻璃效果 默认否
  54. private double blurValue;
  55. private UpdateType updateType = UpdateType.Gitee; //更新源 默认gitee源
  56. private bool selfStartUp = true; //开机自启动设置
  57. private bool selfStartUped = false; //是否已设置
  58. private bool pmModel = false; //性能模式
  59. private string textColor = "#000000"; //字体颜色
  60. private double imgPanelWidth = (double)CommonEnum.IMAGE_PANEL_WIDTH;
  61. private double imgPanelHeight = (double)CommonEnum.IMAGE_PANEL_HEIGHT;
  62. private bool marginHide = false; //贴边隐藏
  63. private bool appAnimation = false; //主窗口动画效果
  64. private int imageWidth = (int)CommonEnum.IMAGE_WIDTH; //图片宽度
  65. private int imageHeight = (int)CommonEnum.IMAGE_HEIGHT; //图片高度
  66. private bool mouseMiddleShow = false; //鼠标中键呼出 默认不启用
  67. private bool showBarIcon = true; //显示托盘图标 默认显示
  68. private bool doubleOpen = false; //双击打开项目 默认关闭
  69. private bool hoverMenu = false; //悬停切换菜单 默认关闭
  70. private BGStyle bgStyle = BGStyle.ImgBac; //背景风格
  71. private GradientBGParam gradientBGParam = null; //渐变背景参数
  72. private bool? enableAppHotKey = true; //可能为null 开启热键
  73. private bool? enableTodoHotKey = true; //可能为null 开启待办热键
  74. private bool enableColorPickerHotKey; //新增 默认为false 不需要考虑null值
  75. private SearchType searchType;
  76. private string sysBakTime; //系统自动备份时间
  77. private string menuPassword; //锁菜单密码
  78. private string passwordHint; //密码提示
  79. private bool? isShow;
  80. private bool itemSpradeAnimation; //列表展开动画
  81. private bool? secondsWindow; //秒数窗口 默认打开
  82. private bool? enableEveryThing;
  83. private bool? alwaysTopmost;
  84. public bool? AlwaysTopmost
  85. {
  86. get
  87. {
  88. if (alwaysTopmost == null) alwaysTopmost = false;
  89. return alwaysTopmost;
  90. }
  91. set
  92. {
  93. alwaysTopmost = value;
  94. OnPropertyChanged("AlwaysTopmost");
  95. }
  96. }
  97. public bool? EnableEveryThing
  98. {
  99. get
  100. {
  101. if (enableEveryThing == null) enableEveryThing = false;
  102. return enableEveryThing;
  103. }
  104. set
  105. {
  106. enableEveryThing = value;
  107. OnPropertyChanged("EnableEveryThing");
  108. }
  109. }
  110. #region GetSet
  111. public bool? SecondsWindow
  112. {
  113. get
  114. {
  115. if (secondsWindow == null) secondsWindow = true;
  116. return secondsWindow;
  117. }
  118. set
  119. {
  120. secondsWindow = value;
  121. OnPropertyChanged("SecondsWindow");
  122. }
  123. }
  124. public bool ItemSpradeAnimation
  125. {
  126. get
  127. {
  128. return itemSpradeAnimation;
  129. }
  130. set
  131. {
  132. itemSpradeAnimation = value;
  133. OnPropertyChanged("ItemSpradeAnimation");
  134. }
  135. }
  136. public bool? IsShow
  137. {
  138. get
  139. {
  140. return isShow;
  141. }
  142. set
  143. {
  144. isShow = value;
  145. OnPropertyChanged("IsShow");
  146. }
  147. }
  148. public string PasswordHint
  149. {
  150. get
  151. {
  152. return passwordHint;
  153. }
  154. set
  155. {
  156. passwordHint = value;
  157. OnPropertyChanged("PasswordHint");
  158. }
  159. }
  160. public string MenuPassword
  161. {
  162. get
  163. {
  164. return menuPassword;
  165. }
  166. set
  167. {
  168. menuPassword = value;
  169. OnPropertyChanged("MenuPassword");
  170. }
  171. }
  172. public string SysBakTime
  173. {
  174. get
  175. {
  176. return sysBakTime;
  177. }
  178. set
  179. {
  180. sysBakTime = value;
  181. }
  182. }
  183. public SearchType SearchType
  184. {
  185. get
  186. {
  187. return searchType;
  188. }
  189. set
  190. {
  191. searchType = value;
  192. OnPropertyChanged("SearchType");
  193. }
  194. }
  195. public bool EnableColorPickerHotKey
  196. {
  197. get
  198. {
  199. return enableColorPickerHotKey;
  200. }
  201. set
  202. {
  203. enableColorPickerHotKey = value;
  204. OnPropertyChanged("EnableColorPickerHotKey");
  205. }
  206. }
  207. public bool? EnableAppHotKey
  208. {
  209. get
  210. {
  211. if (enableAppHotKey == null) enableAppHotKey = true;
  212. return enableAppHotKey;
  213. }
  214. set
  215. {
  216. enableAppHotKey = value;
  217. OnPropertyChanged("EnableAppHotKey");
  218. }
  219. }
  220. public bool? EnableTodoHotKey
  221. {
  222. get
  223. {
  224. if (enableTodoHotKey == null) enableTodoHotKey = true;
  225. return enableTodoHotKey;
  226. }
  227. set
  228. {
  229. enableTodoHotKey = value;
  230. OnPropertyChanged("EnableTodoHotKey");
  231. }
  232. }
  233. public Visibility TitleLogoVisible
  234. {
  235. get
  236. {
  237. return titleLogoVisible;
  238. }
  239. set
  240. {
  241. titleLogoVisible = value;
  242. OnPropertyChanged("TitleLogoVisible");
  243. }
  244. }
  245. public GradientBGParam GradientBGParam
  246. {
  247. get
  248. {
  249. if (gradientBGParam == null)
  250. {
  251. gradientBGParam = GradientBGParamList.GradientBGParams[0];
  252. }
  253. return gradientBGParam;
  254. }
  255. set
  256. {
  257. gradientBGParam = value;
  258. OnPropertyChanged("GradientBGParam");
  259. }
  260. }
  261. public BGStyle BGStyle
  262. {
  263. get
  264. {
  265. if (bgStyle == 0)
  266. {
  267. bgStyle = (BGStyle)1;
  268. }
  269. return bgStyle;
  270. }
  271. set
  272. {
  273. bgStyle = value;
  274. OnPropertyChanged("BGStyle");
  275. }
  276. }
  277. public bool HoverMenu
  278. {
  279. get
  280. {
  281. return hoverMenu;
  282. }
  283. set
  284. {
  285. hoverMenu = value;
  286. OnPropertyChanged("HoverMenu");
  287. }
  288. }
  289. public bool DoubleOpen
  290. {
  291. get
  292. {
  293. return doubleOpen;
  294. }
  295. set
  296. {
  297. doubleOpen = value;
  298. OnPropertyChanged("DoubleOpen");
  299. }
  300. }
  301. public bool ShowBarIcon
  302. {
  303. get
  304. {
  305. return showBarIcon;
  306. }
  307. set
  308. {
  309. showBarIcon = value;
  310. OnPropertyChanged("ShowBarIcon");
  311. }
  312. }
  313. public bool MouseMiddleShow
  314. {
  315. get
  316. {
  317. return mouseMiddleShow;
  318. }
  319. set
  320. {
  321. mouseMiddleShow = value;
  322. OnPropertyChanged("MouseMiddleShow");
  323. }
  324. }
  325. public int ImageWidth
  326. {
  327. get
  328. {
  329. // 为了兼容旧版 暂时使用默认
  330. if (imageWidth == 0)
  331. {
  332. return (int)CommonEnum.IMAGE_WIDTH;
  333. }
  334. else
  335. {
  336. return imageWidth;
  337. }
  338. }
  339. set
  340. {
  341. imageWidth = value;
  342. //同时设置高度
  343. ImageHeight = value;
  344. //计算 容器宽度因子
  345. double i = ((double)imageWidth - (double)CommonEnum.IMAGE_WIDTH) / 5d;
  346. double s = 2.44;
  347. i *= 2d;
  348. while (i > 1)
  349. {
  350. i /= 10d;
  351. }
  352. if (i > 0d)
  353. {
  354. s -= i;
  355. }
  356. if (s < 2.2)
  357. {
  358. s = 2.2;
  359. }
  360. //设置容器宽度
  361. ImgPanelWidth = (int)(ImageWidth * s);
  362. OnPropertyChanged("ImageWidth");
  363. }
  364. }
  365. public int ImageHeight
  366. {
  367. get
  368. {
  369. //都使用宽度来确定大小
  370. // 为了兼容旧版 暂时使用默认
  371. if (imageHeight == 0)
  372. {
  373. return (int)CommonEnum.IMAGE_HEIGHT;
  374. }
  375. else
  376. {
  377. return imageHeight;
  378. }
  379. }
  380. set
  381. {
  382. imageHeight = value;
  383. //计算容器高度因子
  384. double i = ((double)imageHeight - (double)CommonEnum.IMAGE_HEIGHT) / 5d;
  385. while (i > 1)
  386. {
  387. i /= 10d;
  388. }
  389. double s = 2.00;
  390. if (i > 0d)
  391. {
  392. s -= i;
  393. }
  394. if (s < 1.5) s = 1.5;
  395. //设置容器高度
  396. ImgPanelHeight = ImageHeight * s;
  397. OnPropertyChanged("ImageHeight");
  398. }
  399. }
  400. public bool AppAnimation
  401. {
  402. get
  403. {
  404. return appAnimation;
  405. }
  406. set
  407. {
  408. appAnimation = value;
  409. OnPropertyChanged("AppAnimation");
  410. }
  411. }
  412. public bool MarginHide
  413. {
  414. get
  415. {
  416. return marginHide;
  417. }
  418. set
  419. {
  420. marginHide = value;
  421. OnPropertyChanged("MarginHide");
  422. }
  423. }
  424. public double ImgPanelWidth
  425. {
  426. get
  427. {
  428. if (imgPanelWidth == 0d) return (double)CommonEnum.IMAGE_PANEL_WIDTH;
  429. return imgPanelWidth;
  430. }
  431. set
  432. {
  433. imgPanelWidth = value;
  434. OnPropertyChanged("ImgPanelWidth");
  435. }
  436. }
  437. public double ImgPanelHeight
  438. {
  439. get
  440. {
  441. if (imgPanelHeight == 0d) return (double)CommonEnum.IMAGE_PANEL_HEIGHT;
  442. return imgPanelHeight;
  443. }
  444. set
  445. {
  446. imgPanelHeight = value;
  447. OnPropertyChanged("ImgPanelHeight");
  448. }
  449. }
  450. public string TextColor
  451. {
  452. get
  453. {
  454. if (textColor == null) return "#000000";
  455. return textColor;
  456. }
  457. set
  458. {
  459. textColor = value;
  460. OnPropertyChanged("TextColor");
  461. }
  462. }
  463. public bool PMModel
  464. {
  465. get
  466. {
  467. return pmModel;
  468. }
  469. set
  470. {
  471. pmModel = value;
  472. OnPropertyChanged("PMModel");
  473. }
  474. }
  475. public bool SelfStartUped
  476. {
  477. get
  478. {
  479. return selfStartUped;
  480. }
  481. set
  482. {
  483. selfStartUped = value;
  484. OnPropertyChanged("SelfStartUped");
  485. }
  486. }
  487. public bool SelfStartUp
  488. {
  489. get
  490. {
  491. return selfStartUp;
  492. }
  493. set
  494. {
  495. selfStartUp = value;
  496. selfStartUped = true;
  497. OnPropertyChanged("SelfStartUp");
  498. }
  499. }
  500. public Key ColorPickerHotkey
  501. {
  502. get
  503. {
  504. return colorPickerHotkey;
  505. }
  506. set
  507. {
  508. colorPickerHotkey = value;
  509. OnPropertyChanged("ColorPickerHotkey");
  510. }
  511. }
  512. public HotkeyModifiers ColorPickerHotkeyModifiers
  513. {
  514. get
  515. {
  516. return colorPickerHotkeyModifiers;
  517. }
  518. set
  519. {
  520. colorPickerHotkeyModifiers = value;
  521. OnPropertyChanged("ColorPickerHotkeyModifiers");
  522. }
  523. }
  524. public string ColorPickerHotkeyStr
  525. {
  526. get
  527. {
  528. return colorPickerHotkeyStr;
  529. }
  530. set
  531. {
  532. colorPickerHotkeyStr = value;
  533. OnPropertyChanged("ColorPickerHotkeyStr");
  534. }
  535. }
  536. public Key ToDoHotkey
  537. {
  538. get
  539. {
  540. //兼容老版本
  541. if (toDoHotkey == Key.None)
  542. {
  543. toDoHotkey = Key.E;
  544. }
  545. return toDoHotkey;
  546. }
  547. set
  548. {
  549. toDoHotkey = value;
  550. OnPropertyChanged("ToDoHotkey");
  551. }
  552. }
  553. public HotkeyModifiers ToDoHotkeyModifiers
  554. {
  555. get
  556. {
  557. if (toDoHotkeyModifiers == 0)
  558. {
  559. toDoHotkeyModifiers = HotkeyModifiers.MOD_CONTROL | HotkeyModifiers.MOD_SHIFT;
  560. }
  561. return toDoHotkeyModifiers;
  562. }
  563. set
  564. {
  565. toDoHotkeyModifiers = value;
  566. OnPropertyChanged("ToDoHotkeyModifiers");
  567. }
  568. }
  569. public string ToDoHotkeyStr
  570. {
  571. get
  572. {
  573. //兼容老版本
  574. if (toDoHotkeyStr == null)
  575. {
  576. toDoHotkeyStr = "Ctrl + Shift + Q";
  577. }
  578. return toDoHotkeyStr;
  579. }
  580. set
  581. {
  582. toDoHotkeyStr = value;
  583. OnPropertyChanged("ToDoHotkeyStr");
  584. }
  585. }
  586. public UpdateType UpdateType
  587. {
  588. get
  589. {
  590. return updateType;
  591. }
  592. set
  593. {
  594. updateType = value;
  595. OnPropertyChanged("UpdateType");
  596. }
  597. }
  598. public double BlurValue
  599. {
  600. get
  601. {
  602. return blurValue;
  603. }
  604. set
  605. {
  606. blurValue = value;
  607. OnPropertyChanged("BlurValue");
  608. }
  609. }
  610. public bool BlurEffect
  611. {
  612. get
  613. {
  614. return blurEffect;
  615. }
  616. set
  617. {
  618. blurEffect = value;
  619. if (blurEffect)
  620. {
  621. BlurValue = 100;
  622. }
  623. else
  624. {
  625. BlurValue = 0;
  626. }
  627. OnPropertyChanged("BlurEffect");
  628. }
  629. }
  630. public string CustomIconUrl
  631. {
  632. get
  633. {
  634. return customIconUrl;
  635. }
  636. set
  637. {
  638. customIconUrl = value;
  639. OnPropertyChanged("CustomIconUrl");
  640. }
  641. }
  642. public string CustomIconJsonUrl
  643. {
  644. get
  645. {
  646. return customIconJsonUrl;
  647. }
  648. set
  649. {
  650. customIconJsonUrl = value;
  651. OnPropertyChanged("CustomIconJsonUrl");
  652. }
  653. }
  654. public Key Hotkey
  655. {
  656. get
  657. {
  658. return hotkey;
  659. }
  660. set
  661. {
  662. hotkey = value;
  663. OnPropertyChanged("Hotkey");
  664. }
  665. }
  666. public string HotkeyStr
  667. {
  668. get
  669. {
  670. return hotkeyStr;
  671. }
  672. set
  673. {
  674. hotkeyStr = value;
  675. OnPropertyChanged("HotkeyStr");
  676. }
  677. }
  678. public HotkeyModifiers HotkeyModifiers
  679. {
  680. get
  681. {
  682. if (hotkeyModifiers == 0)
  683. {
  684. hotkeyModifiers = HotkeyModifiers.MOD_CONTROL;
  685. }
  686. return hotkeyModifiers;
  687. }
  688. set
  689. {
  690. hotkeyModifiers = value;
  691. OnPropertyChanged("HotkeyModifiers");
  692. }
  693. }
  694. public ObservableCollection<IconInfo> SelectedMenuIcons
  695. {
  696. get
  697. {
  698. return selectedMenuIcons;
  699. }
  700. set
  701. {
  702. selectedMenuIcons = value;
  703. OnPropertyChanged("SelectedMenuIcons");
  704. }
  705. }
  706. public int PannelCornerRadius
  707. {
  708. get
  709. {
  710. return pannelCornerRadius;
  711. }
  712. set
  713. {
  714. pannelCornerRadius = value;
  715. OnPropertyChanged("pannelCornerRadius");
  716. }
  717. }
  718. public int PannelOpacity
  719. {
  720. get
  721. {
  722. return pannelOpacity;
  723. }
  724. set
  725. {
  726. pannelOpacity = value;
  727. OnPropertyChanged("PannelOpacity");
  728. }
  729. }
  730. public int BgOpacity
  731. {
  732. get
  733. {
  734. return bgOpacity;
  735. }
  736. set
  737. {
  738. bgOpacity = value;
  739. OnPropertyChanged("BgOpacity");
  740. }
  741. }
  742. public int CardOpacity
  743. {
  744. get
  745. {
  746. return cardOpacity;
  747. }
  748. set
  749. {
  750. cardOpacity = value;
  751. OnPropertyChanged("CardOpacity");
  752. }
  753. }
  754. public string BacImgName
  755. {
  756. get
  757. {
  758. return bacImgName;
  759. }
  760. set
  761. {
  762. bacImgName = value;
  763. OnPropertyChanged("BacImgName");
  764. }
  765. }
  766. public byte[] ImageByteArr
  767. {
  768. get
  769. {
  770. return imageByteArr;
  771. }
  772. set
  773. {
  774. imageByteArr = value;
  775. OnPropertyChanged("ImageByteArr");
  776. }
  777. }
  778. public BitmapImage BitmapImage
  779. {
  780. get
  781. {
  782. if (imageByteArr == null || imageByteArr.Length == 0)
  783. {
  784. bacImgName = "系统默认";
  785. //Image image = ImageUtil.ByteArrayToImage(Convert.FromBase64String(Constants.DEFAULT_BAC_IMAGE_BASE64));
  786. return ImageUtil.ByteArrToImage(Convert.FromBase64String(Constants.DEFAULT_BAC_IMAGE_BASE64));
  787. }
  788. else
  789. {
  790. return ImageUtil.ByteArrToImage(ImageByteArr);
  791. }
  792. }
  793. set
  794. {
  795. bitmapImage = value;
  796. imageByteArr = ImageUtil.BitmapImageToByte(bitmapImage);
  797. OnPropertyChanged("BitmapImage");
  798. }
  799. }
  800. public bool StartedShowPanel
  801. {
  802. get
  803. {
  804. return startedShowPanel;
  805. }
  806. set
  807. {
  808. startedShowPanel = value;
  809. OnPropertyChanged("StartedShowPanel");
  810. }
  811. }
  812. public AppHideType AppHideType
  813. {
  814. get
  815. {
  816. return appHideType;
  817. }
  818. set
  819. {
  820. appHideType = value;
  821. OnPropertyChanged("AppHideType");
  822. }
  823. }
  824. public Visibility ConfigIconVisible
  825. {
  826. get
  827. {
  828. return configIconVisible;
  829. }
  830. set
  831. {
  832. configIconVisible = value;
  833. OnPropertyChanged("ConfigIconVisible");
  834. }
  835. }
  836. public bool FollowMouse
  837. {
  838. get
  839. {
  840. return followMouse;
  841. }
  842. set
  843. {
  844. followMouse = value;
  845. OnPropertyChanged("FollowMouse");
  846. }
  847. }
  848. public int SelectedMenuIndex
  849. {
  850. get
  851. {
  852. return selectedMenuIndex;
  853. }
  854. set
  855. {
  856. selectedMenuIndex = value;
  857. OnPropertyChanged("SelectedMenuIndex");
  858. }
  859. }
  860. public SortType MenuSortType
  861. {
  862. get
  863. {
  864. return menuSortType;
  865. }
  866. set
  867. {
  868. menuSortType = value;
  869. OnPropertyChanged("MenuSortType");
  870. }
  871. }
  872. public SortType IconSortType
  873. {
  874. get
  875. {
  876. return iconSortType;
  877. }
  878. set
  879. {
  880. iconSortType = value;
  881. OnPropertyChanged("IconSortType");
  882. }
  883. }
  884. public double WindowWidth
  885. {
  886. get
  887. {
  888. return windowWidth;
  889. }
  890. set
  891. {
  892. windowWidth = value;
  893. OnPropertyChanged("WindowWidth");
  894. }
  895. }
  896. public double WindowHeight
  897. {
  898. get
  899. {
  900. return windowHeight;
  901. }
  902. set
  903. {
  904. windowHeight = value;
  905. OnPropertyChanged("WindowHeight");
  906. }
  907. }
  908. public double MenuCardWidth
  909. {
  910. get
  911. {
  912. return menuCardWidth;
  913. }
  914. set
  915. {
  916. menuCardWidth = value;
  917. OnPropertyChanged("MenuCardWidth");
  918. }
  919. }
  920. [field: NonSerializedAttribute()]
  921. public event PropertyChangedEventHandler PropertyChanged;
  922. private void OnPropertyChanged(string propertyName)
  923. {
  924. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  925. CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
  926. }
  927. #endregion
  928. public override String ToString()
  929. {
  930. return JsonConvert.SerializeObject(this);
  931. }
  932. }
  933. }