AppConfig.cs 25 KB

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