using Microsoft.Toolkit.Mvvm.ComponentModel; using Microsoft.Toolkit.Mvvm.Input; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using HBLConsole.Interface; using Newtonsoft.Json; namespace HBLConsole.Model { public class CommunicationSet : ObservableObject { public CommunicationSet() { RemoveCommand = new RelayCommand((o) => { if (RemoveAction != null) RemoveAction(o); }); } public Action RemoveAction { get; set; } /// /// 使用特性对接口反序列化 /// [JsonProperty(TypeNameHandling = TypeNameHandling.Auto)] public IDeviceType Device { get { return _mDevice; } set { _mDevice = value; OnPropertyChanged(); } } private IDeviceType _mDevice; /// /// 是否激活 /// public bool IsActive { get { return _mIsActive; } set { _mIsActive = value; OnPropertyChanged(); } } private bool _mIsActive = true; /// /// 新增设备名称 /// public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } } private string _mDeviceName; /// /// 设备类型 /// public EDeviceType deviceType { get { return _mdeviceType; } set { _mdeviceType = value; OnPropertyChanged(); } } private EDeviceType _mdeviceType; /// /// 客户端启动设备类型 /// public string ClientDeviceType { get; set; } public RelayCommand RemoveCommand { get; set; } } }