110,561
社区成员
发帖
与我相关
我的任务
分享
public abstract class ParamBase : INotifyPropertyChanged
{
public bool ThrowOnInvalidPropertyName { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(String propertyName)
{
this.VerifyPropertyName(propertyName);
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
public class ParamT<ValueType, UnitType> : ParamBase
{
public ParamT(ValueType valueType,UnitType unitType)
{
this._value = valueType;
this._unit = unitType;
}
private ValueType _value;
private UnitType _unit;
public ValueType Value
{
get { return this._value; }
set
{
this._value = value;
base.NotifyPropertyChanged("Value");
}
}
public UnitType Unit
{
get { return this._unit; }
set
{
this._unit = value;
base.NotifyPropertyChanged("Unit");
}
}
}