UctFrmParameterFrmTest.xaml.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using SCADA.CommonCtrl.WpfControl;
  2. using SCADA.CommonLib;
  3. using SCADA.CommonLib.Helper;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace SCADA_DAQ.Customer
  19. {
  20. /// <summary>
  21. /// UctFrmTest.xaml 的交互逻辑
  22. /// </summary>
  23. [UctMenu("启动传参示例",Icon = "TestTube")]
  24. public partial class UctFrmParameterFrmTest : BaseUctFrm
  25. {
  26. /// <summary>
  27. ///
  28. /// </summary>
  29. public UctFrmParameterFrmTest()
  30. {
  31. InitializeComponent();
  32. Log.Info($"普通启动");
  33. }
  34. /// <summary>
  35. ///
  36. /// </summary>
  37. /// <param name="actionParameter"></param>
  38. public UctFrmParameterFrmTest(ActionParameter actionParameter):this()
  39. {
  40. Log.Info($"收到动作参数:{JsonHelper.JsonSerialize(actionParameter)}\r\n" );
  41. }
  42. /// <summary>
  43. ///
  44. /// </summary>
  45. /// <param name="actionParameter"></param>
  46. /// <param name="roleParameter"></param>
  47. public UctFrmParameterFrmTest(ActionParameter actionParameter, RoleParameter roleParameter) : this()
  48. {
  49. Log.Info($"收到动作参数:{JsonHelper.JsonSerialize(actionParameter)}\r\n" +
  50. $"角色参数:{JsonHelper.JsonSerialize(roleParameter)}");
  51. }
  52. }
  53. /// <summary>
  54. ///
  55. /// </summary>
  56. public class ActionParameter : SCADA.CommonLib.ObservableObject
  57. {
  58. /// <summary>
  59. ///
  60. /// </summary>
  61. [AutoViewProperty("姓名")]
  62. public string Name
  63. {
  64. get { return _Name; }
  65. set
  66. {
  67. if (value != _Name)
  68. {
  69. _Name = value;
  70. OnPropertyChanged(nameof(Name));
  71. }
  72. }
  73. }
  74. private string _Name;
  75. /// <summary>
  76. ///
  77. /// </summary>
  78. [AutoViewProperty("年龄")]
  79. public int Age
  80. {
  81. get { return _Age; }
  82. set
  83. {
  84. if (value != _Age)
  85. {
  86. _Age = value;
  87. OnPropertyChanged(nameof(Age));
  88. }
  89. }
  90. }
  91. private int _Age;
  92. }
  93. /// <summary>
  94. ///
  95. /// </summary>
  96. public class RoleParameter : SCADA.CommonLib.ObservableObject
  97. {
  98. /// <summary>
  99. ///
  100. /// </summary>
  101. [AutoViewProperty("角色")]
  102. public string RoleName
  103. {
  104. get { return _RoleName; }
  105. set
  106. {
  107. if (value != _RoleName)
  108. {
  109. _RoleName = value;
  110. OnPropertyChanged(nameof(RoleName));
  111. }
  112. }
  113. }
  114. private string _RoleName;
  115. }
  116. }