EPLAN_PROD_Plugin/Sinvo.EplanHpD.Plugin.WPFUI/Models/WireCheck/CheckedModel.cs

71 lines
1.9 KiB
C#

using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
{
public class CheckedModel : INotifyPropertyChanged
{
private bool isChecked = false;
private bool isError = false;
private int errorCount = 0;
private string checkedMsg;
private bool isIgnore = false;
/// <summary>
/// 是否已检查
/// </summary>
public bool IsChecked
{
get => isChecked;
set => SetProperty(ref isChecked, value);
}
/// <summary>
/// 是否存在异常
/// </summary>
public bool IsError
{
get => isError;
set => SetProperty(ref isError, value);
}
/// <summary>
/// 异常数
/// </summary>
public int ErrorCount
{
get => errorCount;
set => SetProperty(ref errorCount, value);
}
/// <summary>
/// 检查信息
/// </summary>
public string CheckedMsg
{
get => checkedMsg;
set => SetProperty(ref checkedMsg, value);
}
/// <summary>
/// 是否忽略
/// </summary>
public bool IsIgnore
{
get => isIgnore;
set => SetProperty(ref isIgnore, value);
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
//if (Equals(field, value)) return false;
field = value;
OnPropertyChanged(propertyName);
return true;
}
}
}