27 lines
891 B
C#
27 lines
891 B
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
namespace Cardiopulmonarybypasssystems.Models;
|
|
|
|
public partial class ValveControlChannel : ObservableObject
|
|
{
|
|
public required string Key { get; init; }
|
|
public required string Name { get; init; }
|
|
public int StartAddress { get; init; }
|
|
|
|
[ObservableProperty]
|
|
private bool isOpen;
|
|
|
|
public string StateText => IsOpen ? "开启" : "关闭";
|
|
public string ActionText => IsOpen ? "关闭阀门" : "开启阀门";
|
|
public string IndicatorColor => IsOpen ? "#FF32B06A" : "#FFC8D4DA";
|
|
public string StateHint => IsOpen ? "测试回路已导通" : "测试回路已关闭";
|
|
|
|
partial void OnIsOpenChanged(bool value)
|
|
{
|
|
OnPropertyChanged(nameof(StateText));
|
|
OnPropertyChanged(nameof(ActionText));
|
|
OnPropertyChanged(nameof(IndicatorColor));
|
|
OnPropertyChanged(nameof(StateHint));
|
|
}
|
|
}
|