AppConfig.cs 24 KB

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