using System.ComponentModel; using System.Runtime.CompilerServices; namespace DispenserUI.ViewModels.DTO; /// /// 系统设备状态 /// public class SystemStatus(string name) : INotifyPropertyChanged { private bool _isNormal = true; private string _tip; private string _icon; private string _background = "Transparent"; private string _foreground = "#36394A"; public string Name { get => name; } public bool IsNormal { get => _isNormal; set { _isNormal = value; OnPropertyChanged(); } } public string Tip { get => _tip; set { _tip = value; OnPropertyChanged(); } } public string Icon { get => _icon; set { _icon = value; OnPropertyChanged(); } } public string Background { get => _background; set { _background = value; OnPropertyChanged(); } } public string Foreground { get => _foreground; set { _foreground = value; OnPropertyChanged(); } } public event PropertyChangedEventHandler? PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } }