123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- using SCADA.CommonCtrl.WpfControl;
- using SCADA.CommonLib;
- using SCADA.CommonLib.Helper;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace SCADA_DAQ.Customer
- {
- /// <summary>
- /// UctFrmTest.xaml 的交互逻辑
- /// </summary>
- [UctMenu("启动传参示例",Icon = "TestTube")]
- public partial class UctFrmParameterFrmTest : BaseUctFrm
- {
- /// <summary>
- ///
- /// </summary>
- public UctFrmParameterFrmTest()
- {
- InitializeComponent();
- Log.Info($"普通启动");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="actionParameter"></param>
- public UctFrmParameterFrmTest(ActionParameter actionParameter):this()
- {
- Log.Info($"收到动作参数:{JsonHelper.JsonSerialize(actionParameter)}\r\n" );
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="actionParameter"></param>
- /// <param name="roleParameter"></param>
- public UctFrmParameterFrmTest(ActionParameter actionParameter, RoleParameter roleParameter) : this()
- {
- Log.Info($"收到动作参数:{JsonHelper.JsonSerialize(actionParameter)}\r\n" +
- $"角色参数:{JsonHelper.JsonSerialize(roleParameter)}");
- }
- }
- /// <summary>
- ///
- /// </summary>
- public class ActionParameter : SCADA.CommonLib.ObservableObject
- {
- /// <summary>
- ///
- /// </summary>
- [AutoViewProperty("姓名")]
- public string Name
- {
- get { return _Name; }
- set
- {
- if (value != _Name)
- {
- _Name = value;
- OnPropertyChanged(nameof(Name));
- }
- }
- }
- private string _Name;
- /// <summary>
- ///
- /// </summary>
- [AutoViewProperty("年龄")]
- public int Age
- {
- get { return _Age; }
- set
- {
- if (value != _Age)
- {
- _Age = value;
- OnPropertyChanged(nameof(Age));
- }
- }
- }
- private int _Age;
- }
- /// <summary>
- ///
- /// </summary>
- public class RoleParameter : SCADA.CommonLib.ObservableObject
- {
- /// <summary>
- ///
- /// </summary>
- [AutoViewProperty("角色")]
- public string RoleName
- {
- get { return _RoleName; }
- set
- {
- if (value != _RoleName)
- {
- _RoleName = value;
- OnPropertyChanged(nameof(RoleName));
- }
- }
- }
- private string _RoleName;
- }
- }
|