1
0

AppConfig.cs 24 KB

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