60 lines
1.4 KiB
C#
60 lines
1.4 KiB
C#
using System.ComponentModel;
|
||
using System.Runtime.CompilerServices;
|
||
|
||
namespace MembranePoreTester.Models
|
||
{
|
||
// 数据点实现 INotifyPropertyChanged,保证 UI(DataGrid/Plot)在属性变化时刷新
|
||
public class DataPoint : INotifyPropertyChanged
|
||
{
|
||
private double _pressure;
|
||
private double _wetFlow;
|
||
private double _dryFlow;
|
||
|
||
public double Pressure
|
||
{
|
||
get => _pressure;
|
||
set
|
||
{
|
||
if (_pressure != value)
|
||
{
|
||
_pressure = value;
|
||
OnPropertyChanged();
|
||
}
|
||
}
|
||
}
|
||
|
||
public double WetFlow
|
||
{
|
||
get => _wetFlow;
|
||
set
|
||
{
|
||
if (_wetFlow != value)
|
||
{
|
||
_wetFlow = value;
|
||
OnPropertyChanged();
|
||
}
|
||
}
|
||
}
|
||
|
||
public double DryFlow
|
||
{
|
||
get => _dryFlow;
|
||
set
|
||
{
|
||
if (_dryFlow != value)
|
||
{
|
||
_dryFlow = value;
|
||
OnPropertyChanged();
|
||
}
|
||
}
|
||
}
|
||
|
||
public event PropertyChangedEventHandler PropertyChanged;
|
||
|
||
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||
{
|
||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||
}
|
||
}
|
||
}
|