BaseModel.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Caliburn.Micro.Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace MECF.Framework.UI.Client.ClientBase
  8. {
  9. public class BaseModel : Screen
  10. {
  11. public BaseModel()
  12. {
  13. }
  14. public string CurrentMenuID { get; set; }
  15. public PageID Page { get; set; }
  16. private int permission = 0;
  17. private int token = 0;
  18. public int Permission
  19. {
  20. get { return this.permission; }
  21. set
  22. {
  23. if (this.permission != value)
  24. {
  25. this.permission = value;
  26. this.NotifyOfPropertyChange("Permission");
  27. }
  28. }
  29. }
  30. public bool HasToken { get { return this.token > 0 ? true : false; } }
  31. public int Token
  32. {
  33. get { return this.token; }
  34. set
  35. {
  36. if (this.token != value)
  37. {
  38. this.token = value;
  39. OnTokenChanged(this.token);
  40. this.NotifyOfPropertyChange("Token");
  41. }
  42. }
  43. }
  44. protected virtual void OnTokenChanged(int nNewToken) { }
  45. protected override void OnActivate()
  46. {
  47. base.OnActivate();
  48. }
  49. protected override void OnDeactivate(bool close)
  50. {
  51. base.OnDeactivate(close);
  52. }
  53. }
  54. }