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 { /// /// 使用特性对接口反序列化 /// [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; } }