Files
Z173/Models/StageData.cs

38 lines
1017 B
C#
Raw Permalink Normal View History

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