终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 2 години
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Collections.ObjectModel;
  7. using Microsoft.Toolkit.Mvvm.ComponentModel;
  8. using BPASmartClient.CustomResource.Pages.Enums;
  9. using System.Windows;
  10. namespace BPASmartClient.CustomResource.Pages.Model
  11. {
  12. /// <summary>
  13. /// 在启动界面之前设置菜单项
  14. /// </summary>
  15. public class MenuManage : ObservableObject
  16. {
  17. private volatile static MenuManage _Instance;
  18. public static MenuManage GetInstance => _Instance ?? (_Instance = new MenuManage());
  19. private MenuManage() { }
  20. public ObservableCollection<MenuModel> menuModels { get; set; } = new ObservableCollection<MenuModel>();
  21. }
  22. public class MenuModel : ObservableObject
  23. {
  24. /// <summary>
  25. /// 主菜单权限
  26. /// </summary>
  27. public Permission[] MainMenuPermission { get { return _mMainMenuPermission; } set { _mMainMenuPermission = value; OnPropertyChanged(); } }
  28. private Permission[] _mMainMenuPermission;
  29. /// <summary>
  30. /// 主菜单图标
  31. /// </summary>
  32. public string MainMenuIcon { get { return _mMainMenuIcon; } set { _mMainMenuIcon = value; OnPropertyChanged(); } }
  33. private string _mMainMenuIcon = string.Empty;
  34. /// <summary>
  35. /// 主菜单名称
  36. /// </summary>
  37. public string MainMenuName { get { return _mMainMenuName; } set { _mMainMenuName = value; OnPropertyChanged(); } }
  38. private string _mMainMenuName = string.Empty;
  39. /// <summary>
  40. /// 别名(英文名)
  41. /// </summary>
  42. public string Alias { get { return _mAlias; } set { _mAlias = value; OnPropertyChanged(); } }
  43. private string _mAlias = string.Empty;
  44. /// <summary>
  45. /// 主菜单的显示隐藏设置
  46. /// </summary>
  47. public Visibility MainMenuVisibility { get { return _mMainMenuVisibility; } set { _mMainMenuVisibility = value; OnPropertyChanged(); } }
  48. private Visibility _mMainMenuVisibility;
  49. /// <summary>
  50. /// 子菜单集合
  51. /// </summary>
  52. public ObservableCollection<SubMenumodel> subMenumodels { get; set; } = new ObservableCollection<SubMenumodel>();
  53. }
  54. public class SubMenumodel : ObservableObject
  55. {
  56. /// <summary>
  57. /// 子菜单名称
  58. /// </summary>
  59. public string SubMenuName { get { return _mSubMenuName; } set { _mSubMenuName = value; OnPropertyChanged(); } }
  60. private string _mSubMenuName = string.Empty;
  61. /// <summary>
  62. /// 子菜单权限管理
  63. /// </summary>
  64. public Permission[] SubMenuPermission { get { return _mSubMenuPermission; } set { _mSubMenuPermission = value; OnPropertyChanged(); } }
  65. private Permission[] _mSubMenuPermission;
  66. /// <summary>
  67. /// 切换界面路径
  68. /// </summary>
  69. public string ToggleWindowPath { get { return _mToggleWindowPath; } set { _mToggleWindowPath = value; OnPropertyChanged(); } }
  70. private string _mToggleWindowPath = string.Empty;
  71. /// <summary>
  72. /// 程序集名称
  73. /// </summary>
  74. public string AssemblyName { get { return _mAssemblyName; } set { _mAssemblyName = value; OnPropertyChanged(); } }
  75. private string _mAssemblyName = string.Empty;
  76. /// <summary>
  77. /// 子菜单的显示隐藏设置
  78. /// </summary>
  79. public Visibility SubMenuVisibility { get { return _mSubMenuVisibility; } set { _mSubMenuVisibility = value; OnPropertyChanged(); } }
  80. private Visibility _mSubMenuVisibility;
  81. }
  82. }