AppConfig.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999
  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. #region GetSet
  83. public bool? SecondsWindow
  84. {
  85. get
  86. {
  87. if (secondsWindow == null) secondsWindow = true;
  88. return secondsWindow;
  89. }
  90. set
  91. {
  92. secondsWindow = value;
  93. OnPropertyChanged("SecondsWindow");
  94. }
  95. }
  96. public bool ItemSpradeAnimation
  97. {
  98. get
  99. {
  100. return itemSpradeAnimation;
  101. }
  102. set
  103. {
  104. itemSpradeAnimation = value;
  105. OnPropertyChanged("ItemSpradeAnimation");
  106. }
  107. }
  108. public bool? IsShow
  109. {
  110. get
  111. {
  112. return isShow;
  113. }
  114. set
  115. {
  116. isShow = value;
  117. OnPropertyChanged("IsShow");
  118. }
  119. }
  120. public string PasswordHint
  121. {
  122. get
  123. {
  124. return passwordHint;
  125. }
  126. set
  127. {
  128. passwordHint = value;
  129. OnPropertyChanged("PasswordHint");
  130. }
  131. }
  132. public string MenuPassword
  133. {
  134. get
  135. {
  136. return menuPassword;
  137. }
  138. set
  139. {
  140. menuPassword = value;
  141. OnPropertyChanged("MenuPassword");
  142. }
  143. }
  144. public string SysBakTime
  145. {
  146. get
  147. {
  148. return sysBakTime;
  149. }
  150. set
  151. {
  152. sysBakTime = value;
  153. }
  154. }
  155. public SearchType SearchType
  156. {
  157. get
  158. {
  159. return searchType;
  160. }
  161. set
  162. {
  163. searchType = value;
  164. OnPropertyChanged("SearchType");
  165. }
  166. }
  167. public bool EnableColorPickerHotKey
  168. {
  169. get
  170. {
  171. return enableColorPickerHotKey;
  172. }
  173. set
  174. {
  175. enableColorPickerHotKey = value;
  176. OnPropertyChanged("EnableColorPickerHotKey");
  177. }
  178. }
  179. public bool? EnableAppHotKey
  180. {
  181. get
  182. {
  183. if (enableAppHotKey == null) enableAppHotKey = true;
  184. return enableAppHotKey;
  185. }
  186. set
  187. {
  188. enableAppHotKey = value;
  189. OnPropertyChanged("EnableAppHotKey");
  190. }
  191. }
  192. public bool? EnableTodoHotKey
  193. {
  194. get
  195. {
  196. if (enableTodoHotKey == null) enableTodoHotKey = true;
  197. return enableTodoHotKey;
  198. }
  199. set
  200. {
  201. enableTodoHotKey = value;
  202. OnPropertyChanged("EnableTodoHotKey");
  203. }
  204. }
  205. public Visibility TitleLogoVisible
  206. {
  207. get
  208. {
  209. return titleLogoVisible;
  210. }
  211. set
  212. {
  213. titleLogoVisible = value;
  214. OnPropertyChanged("TitleLogoVisible");
  215. }
  216. }
  217. public GradientBGParam GradientBGParam
  218. {
  219. get
  220. {
  221. if (gradientBGParam == null)
  222. {
  223. gradientBGParam = GradientBGParamList.GradientBGParams[0];
  224. }
  225. return gradientBGParam;
  226. }
  227. set
  228. {
  229. gradientBGParam = value;
  230. OnPropertyChanged("GradientBGParam");
  231. }
  232. }
  233. public BGStyle BGStyle
  234. {
  235. get
  236. {
  237. if (bgStyle == 0)
  238. {
  239. bgStyle = (BGStyle)1;
  240. }
  241. return bgStyle;
  242. }
  243. set
  244. {
  245. bgStyle = value;
  246. OnPropertyChanged("BGStyle");
  247. }
  248. }
  249. public bool HoverMenu
  250. {
  251. get
  252. {
  253. return hoverMenu;
  254. }
  255. set
  256. {
  257. hoverMenu = value;
  258. OnPropertyChanged("HoverMenu");
  259. }
  260. }
  261. public bool DoubleOpen
  262. {
  263. get
  264. {
  265. return doubleOpen;
  266. }
  267. set
  268. {
  269. doubleOpen = value;
  270. OnPropertyChanged("DoubleOpen");
  271. }
  272. }
  273. public bool ShowBarIcon
  274. {
  275. get
  276. {
  277. return showBarIcon;
  278. }
  279. set
  280. {
  281. showBarIcon = value;
  282. OnPropertyChanged("ShowBarIcon");
  283. }
  284. }
  285. public bool MouseMiddleShow
  286. {
  287. get
  288. {
  289. return mouseMiddleShow;
  290. }
  291. set
  292. {
  293. mouseMiddleShow = value;
  294. OnPropertyChanged("MouseMiddleShow");
  295. }
  296. }
  297. public int ImageWidth
  298. {
  299. get
  300. {
  301. // 为了兼容旧版 暂时使用默认
  302. if (imageWidth == 0)
  303. {
  304. return (int)CommonEnum.IMAGE_WIDTH;
  305. }
  306. else
  307. {
  308. return imageWidth;
  309. }
  310. }
  311. set
  312. {
  313. imageWidth = value;
  314. //同时设置高度
  315. ImageHeight = value;
  316. //计算 容器宽度因子
  317. double i = ((double)imageWidth - (double)CommonEnum.IMAGE_WIDTH) / 5d;
  318. double s = 2.44;
  319. i *= 2d;
  320. while (i > 1)
  321. {
  322. i /= 10d;
  323. }
  324. if (i > 0d)
  325. {
  326. s -= i;
  327. }
  328. if (s < 2.2)
  329. {
  330. s = 2.2;
  331. }
  332. //设置容器宽度
  333. ImgPanelWidth = (int)(ImageWidth * s);
  334. OnPropertyChanged("ImageWidth");
  335. }
  336. }
  337. public int ImageHeight
  338. {
  339. get
  340. {
  341. //都使用宽度来确定大小
  342. // 为了兼容旧版 暂时使用默认
  343. if (imageHeight == 0)
  344. {
  345. return (int)CommonEnum.IMAGE_HEIGHT;
  346. }
  347. else
  348. {
  349. return imageHeight;
  350. }
  351. }
  352. set
  353. {
  354. imageHeight = value;
  355. //计算容器高度因子
  356. double i = ((double)imageHeight - (double)CommonEnum.IMAGE_HEIGHT) / 5d;
  357. while (i > 1)
  358. {
  359. i /= 10d;
  360. }
  361. double s = 2.00;
  362. if (i > 0d)
  363. {
  364. s -= i;
  365. }
  366. if (s < 1.5) s = 1.5;
  367. //设置容器高度
  368. ImgPanelHeight = ImageHeight * s;
  369. OnPropertyChanged("ImageHeight");
  370. }
  371. }
  372. public bool AppAnimation
  373. {
  374. get
  375. {
  376. return appAnimation;
  377. }
  378. set
  379. {
  380. appAnimation = value;
  381. OnPropertyChanged("AppAnimation");
  382. }
  383. }
  384. public bool MarginHide
  385. {
  386. get
  387. {
  388. return marginHide;
  389. }
  390. set
  391. {
  392. marginHide = value;
  393. OnPropertyChanged("MarginHide");
  394. }
  395. }
  396. public double ImgPanelWidth
  397. {
  398. get
  399. {
  400. if (imgPanelWidth == 0d) return (double)CommonEnum.IMAGE_PANEL_WIDTH;
  401. return imgPanelWidth;
  402. }
  403. set
  404. {
  405. imgPanelWidth = value;
  406. OnPropertyChanged("ImgPanelWidth");
  407. }
  408. }
  409. public double ImgPanelHeight
  410. {
  411. get
  412. {
  413. if (imgPanelHeight == 0d) return (double)CommonEnum.IMAGE_PANEL_HEIGHT;
  414. return imgPanelHeight;
  415. }
  416. set
  417. {
  418. imgPanelHeight = value;
  419. OnPropertyChanged("ImgPanelHeight");
  420. }
  421. }
  422. public string TextColor
  423. {
  424. get
  425. {
  426. if (textColor == null) return "#000000";
  427. return textColor;
  428. }
  429. set
  430. {
  431. textColor = value;
  432. OnPropertyChanged("TextColor");
  433. }
  434. }
  435. public bool PMModel
  436. {
  437. get
  438. {
  439. return pmModel;
  440. }
  441. set
  442. {
  443. pmModel = value;
  444. OnPropertyChanged("PMModel");
  445. }
  446. }
  447. public bool SelfStartUped
  448. {
  449. get
  450. {
  451. return selfStartUped;
  452. }
  453. set
  454. {
  455. selfStartUped = value;
  456. OnPropertyChanged("SelfStartUped");
  457. }
  458. }
  459. public bool SelfStartUp
  460. {
  461. get
  462. {
  463. return selfStartUp;
  464. }
  465. set
  466. {
  467. selfStartUp = value;
  468. selfStartUped = true;
  469. OnPropertyChanged("SelfStartUp");
  470. }
  471. }
  472. public Key ColorPickerHotkey
  473. {
  474. get
  475. {
  476. return colorPickerHotkey;
  477. }
  478. set
  479. {
  480. colorPickerHotkey = value;
  481. OnPropertyChanged("ColorPickerHotkey");
  482. }
  483. }
  484. public HotkeyModifiers ColorPickerHotkeyModifiers
  485. {
  486. get
  487. {
  488. return colorPickerHotkeyModifiers;
  489. }
  490. set
  491. {
  492. colorPickerHotkeyModifiers = value;
  493. OnPropertyChanged("ColorPickerHotkeyModifiers");
  494. }
  495. }
  496. public string ColorPickerHotkeyStr
  497. {
  498. get
  499. {
  500. return colorPickerHotkeyStr;
  501. }
  502. set
  503. {
  504. colorPickerHotkeyStr = value;
  505. OnPropertyChanged("ColorPickerHotkeyStr");
  506. }
  507. }
  508. public Key ToDoHotkey
  509. {
  510. get
  511. {
  512. //兼容老版本
  513. if (toDoHotkey == Key.None)
  514. {
  515. toDoHotkey = Key.E;
  516. }
  517. return toDoHotkey;
  518. }
  519. set
  520. {
  521. toDoHotkey = value;
  522. OnPropertyChanged("ToDoHotkey");
  523. }
  524. }
  525. public HotkeyModifiers ToDoHotkeyModifiers
  526. {
  527. get
  528. {
  529. if (toDoHotkeyModifiers == 0)
  530. {
  531. toDoHotkeyModifiers = HotkeyModifiers.MOD_CONTROL | HotkeyModifiers.MOD_SHIFT;
  532. }
  533. return toDoHotkeyModifiers;
  534. }
  535. set
  536. {
  537. toDoHotkeyModifiers = value;
  538. OnPropertyChanged("ToDoHotkeyModifiers");
  539. }
  540. }
  541. public string ToDoHotkeyStr
  542. {
  543. get
  544. {
  545. //兼容老版本
  546. if (toDoHotkeyStr == null)
  547. {
  548. toDoHotkeyStr = "Ctrl + Shift + Q";
  549. }
  550. return toDoHotkeyStr;
  551. }
  552. set
  553. {
  554. toDoHotkeyStr = value;
  555. OnPropertyChanged("ToDoHotkeyStr");
  556. }
  557. }
  558. public UpdateType UpdateType
  559. {
  560. get
  561. {
  562. return updateType;
  563. }
  564. set
  565. {
  566. updateType = value;
  567. OnPropertyChanged("UpdateType");
  568. }
  569. }
  570. public double BlurValue
  571. {
  572. get
  573. {
  574. return blurValue;
  575. }
  576. set
  577. {
  578. blurValue = value;
  579. OnPropertyChanged("BlurValue");
  580. }
  581. }
  582. public bool BlurEffect
  583. {
  584. get
  585. {
  586. return blurEffect;
  587. }
  588. set
  589. {
  590. blurEffect = value;
  591. if (blurEffect)
  592. {
  593. BlurValue = 100;
  594. }
  595. else
  596. {
  597. BlurValue = 0;
  598. }
  599. OnPropertyChanged("BlurEffect");
  600. }
  601. }
  602. public string CustomIconUrl
  603. {
  604. get
  605. {
  606. return customIconUrl;
  607. }
  608. set
  609. {
  610. customIconUrl = value;
  611. OnPropertyChanged("CustomIconUrl");
  612. }
  613. }
  614. public string CustomIconJsonUrl
  615. {
  616. get
  617. {
  618. return customIconJsonUrl;
  619. }
  620. set
  621. {
  622. customIconJsonUrl = value;
  623. OnPropertyChanged("CustomIconJsonUrl");
  624. }
  625. }
  626. public Key Hotkey
  627. {
  628. get
  629. {
  630. return hotkey;
  631. }
  632. set
  633. {
  634. hotkey = value;
  635. OnPropertyChanged("Hotkey");
  636. }
  637. }
  638. public string HotkeyStr
  639. {
  640. get
  641. {
  642. return hotkeyStr;
  643. }
  644. set
  645. {
  646. hotkeyStr = value;
  647. OnPropertyChanged("HotkeyStr");
  648. }
  649. }
  650. public HotkeyModifiers HotkeyModifiers
  651. {
  652. get
  653. {
  654. if (hotkeyModifiers == 0)
  655. {
  656. hotkeyModifiers = HotkeyModifiers.MOD_CONTROL;
  657. }
  658. return hotkeyModifiers;
  659. }
  660. set
  661. {
  662. hotkeyModifiers = value;
  663. OnPropertyChanged("HotkeyModifiers");
  664. }
  665. }
  666. public ObservableCollection<IconInfo> SelectedMenuIcons
  667. {
  668. get
  669. {
  670. return selectedMenuIcons;
  671. }
  672. set
  673. {
  674. selectedMenuIcons = value;
  675. OnPropertyChanged("SelectedMenuIcons");
  676. }
  677. }
  678. public int PannelCornerRadius
  679. {
  680. get
  681. {
  682. return pannelCornerRadius;
  683. }
  684. set
  685. {
  686. pannelCornerRadius = value;
  687. OnPropertyChanged("pannelCornerRadius");
  688. }
  689. }
  690. public int PannelOpacity
  691. {
  692. get
  693. {
  694. return pannelOpacity;
  695. }
  696. set
  697. {
  698. pannelOpacity = value;
  699. OnPropertyChanged("PannelOpacity");
  700. }
  701. }
  702. public int BgOpacity
  703. {
  704. get
  705. {
  706. return bgOpacity;
  707. }
  708. set
  709. {
  710. bgOpacity = value;
  711. OnPropertyChanged("BgOpacity");
  712. }
  713. }
  714. public int CardOpacity
  715. {
  716. get
  717. {
  718. return cardOpacity;
  719. }
  720. set
  721. {
  722. cardOpacity = value;
  723. OnPropertyChanged("CardOpacity");
  724. }
  725. }
  726. public string BacImgName
  727. {
  728. get
  729. {
  730. return bacImgName;
  731. }
  732. set
  733. {
  734. bacImgName = value;
  735. OnPropertyChanged("BacImgName");
  736. }
  737. }
  738. public byte[] ImageByteArr
  739. {
  740. get
  741. {
  742. return imageByteArr;
  743. }
  744. set
  745. {
  746. imageByteArr = value;
  747. OnPropertyChanged("ImageByteArr");
  748. }
  749. }
  750. public BitmapImage BitmapImage
  751. {
  752. get
  753. {
  754. if (imageByteArr == null || imageByteArr.Length == 0)
  755. {
  756. bacImgName = "系统默认";
  757. //Image image = ImageUtil.ByteArrayToImage(Convert.FromBase64String(Constants.DEFAULT_BAC_IMAGE_BASE64));
  758. return ImageUtil.ByteArrToImage(Convert.FromBase64String(Constants.DEFAULT_BAC_IMAGE_BASE64));
  759. }
  760. else
  761. {
  762. return ImageUtil.ByteArrToImage(ImageByteArr);
  763. }
  764. }
  765. set
  766. {
  767. bitmapImage = value;
  768. imageByteArr = ImageUtil.BitmapImageToByte(bitmapImage);
  769. OnPropertyChanged("BitmapImage");
  770. }
  771. }
  772. public bool StartedShowPanel
  773. {
  774. get
  775. {
  776. return startedShowPanel;
  777. }
  778. set
  779. {
  780. startedShowPanel = value;
  781. OnPropertyChanged("StartedShowPanel");
  782. }
  783. }
  784. public AppHideType AppHideType
  785. {
  786. get
  787. {
  788. return appHideType;
  789. }
  790. set
  791. {
  792. appHideType = value;
  793. OnPropertyChanged("AppHideType");
  794. }
  795. }
  796. public Visibility ConfigIconVisible
  797. {
  798. get
  799. {
  800. return configIconVisible;
  801. }
  802. set
  803. {
  804. configIconVisible = value;
  805. OnPropertyChanged("ConfigIconVisible");
  806. }
  807. }
  808. public bool FollowMouse
  809. {
  810. get
  811. {
  812. return followMouse;
  813. }
  814. set
  815. {
  816. followMouse = value;
  817. OnPropertyChanged("FollowMouse");
  818. }
  819. }
  820. public int SelectedMenuIndex
  821. {
  822. get
  823. {
  824. return selectedMenuIndex;
  825. }
  826. set
  827. {
  828. selectedMenuIndex = value;
  829. OnPropertyChanged("SelectedMenuIndex");
  830. }
  831. }
  832. public SortType MenuSortType
  833. {
  834. get
  835. {
  836. return menuSortType;
  837. }
  838. set
  839. {
  840. menuSortType = value;
  841. OnPropertyChanged("MenuSortType");
  842. }
  843. }
  844. public SortType IconSortType
  845. {
  846. get
  847. {
  848. return iconSortType;
  849. }
  850. set
  851. {
  852. iconSortType = value;
  853. OnPropertyChanged("IconSortType");
  854. }
  855. }
  856. public double WindowWidth
  857. {
  858. get
  859. {
  860. return windowWidth;
  861. }
  862. set
  863. {
  864. windowWidth = value;
  865. OnPropertyChanged("WindowWidth");
  866. }
  867. }
  868. public double WindowHeight
  869. {
  870. get
  871. {
  872. return windowHeight;
  873. }
  874. set
  875. {
  876. windowHeight = value;
  877. OnPropertyChanged("WindowHeight");
  878. }
  879. }
  880. public double MenuCardWidth
  881. {
  882. get
  883. {
  884. return menuCardWidth;
  885. }
  886. set
  887. {
  888. menuCardWidth = value;
  889. OnPropertyChanged("MenuCardWidth");
  890. }
  891. }
  892. [field: NonSerializedAttribute()]
  893. public event PropertyChangedEventHandler PropertyChanged;
  894. private void OnPropertyChanged(string propertyName)
  895. {
  896. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  897. CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
  898. }
  899. #endregion
  900. public override String ToString()
  901. {
  902. return JsonConvert.SerializeObject(this);
  903. }
  904. }
  905. }