SysContextMenuItem.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using GalaSoft.MvvmLight;
  2. using Muchinfo.MTPClient.Data.Enums;
  3. using System.Collections.Generic;
  4. using System.Windows;
  5. namespace Muchinfo.MTPClient.Data
  6. {
  7. /// <summary>
  8. /// SysContextMenuItem类
  9. /// </summary>
  10. public class SysContextMenuItem : ViewModelBase
  11. {
  12. /// <summary>
  13. /// Initializes a new instance of the <see cref="SysContextMenuItem"/> class.
  14. /// </summary>
  15. /// <param name="title">The title.</param>
  16. /// <param name="type">The type.</param>
  17. public SysContextMenuItem(string title, ContextMenuCommandType type)
  18. {
  19. this.Title = title;
  20. this.CommandType = type;
  21. _isEnable = true;
  22. }
  23. /// <summary>
  24. /// 获取和设置the title
  25. /// </summary>
  26. public string Title { get; set; }
  27. private bool _isEnable;
  28. /// <summary>
  29. /// 菜单 是否可用
  30. /// </summary>
  31. public bool IsEnable
  32. {
  33. get { return _isEnable; }
  34. set { Set(() => IsEnable, ref _isEnable, value); }
  35. }
  36. private Visibility _isVisiable;
  37. /// <summary>
  38. /// 菜单 是否可用
  39. /// </summary>
  40. public Visibility IsVisiable
  41. {
  42. get { return _isVisiable; }
  43. set { Set(() => IsVisiable, ref _isVisiable, value); }
  44. }
  45. /// <summary>
  46. /// Gets or sets the type of the command.
  47. /// </summary>
  48. public ContextMenuCommandType CommandType { get; set; }
  49. /// <summary>
  50. /// 子菜单
  51. /// </summary>
  52. public List<SysContextMenuItem> Children
  53. {
  54. get;
  55. set;
  56. }
  57. }
  58. }