Files
Z173/Models/StageData.cs
2026-06-16 21:18:46 +08:00

38 lines
1017 B
C#

using CommunityToolkit.Mvvm.ComponentModel;
namespace AciTester.Models
{
public partial class StageData : ObservableObject
{
[ObservableProperty]
private string stageName;
[ObservableProperty]
private double cutoffDiameter;
private double _initialWeight;
public double InitialWeight
{
get => _initialWeight;
set
{
if (SetProperty(ref _initialWeight, value))
OnPropertyChanged(nameof(NetWeight)); // 关键:通知净重变化
}
}
private double _finalWeight;
public double FinalWeight
{
get => _finalWeight;
set
{
if (SetProperty(ref _finalWeight, value))
OnPropertyChanged(nameof(NetWeight)); // 关键:通知净重变化
}
}
// 计算属性,不存储
public double NetWeight => FinalWeight - InitialWeight;
}
}