I have a class where I define one property normally as follows:
public class MeasurementPoint : ModelBase
{
private double _value;
public double Value
{
get { return _value; }
set
{
_value = value;
NotifyPropertyChanged();
}
}
}
Next I have created a collection which contains many of the 'MeasurementPoint' objects. I would want to raise the notifyPropertyChanged on every object which meets certain value logic.
At the moment this method works, and the propertyChanged is raised. However, surely there is a more efficient way to do this?
private void RefreshDataGridTolerance()
{
foreach (var measurementPoint in DataSet)
{
//TODO: Change this into a real way to raiseproperty changed without actually changing the value
var temp = measurementPoint.Value;
measurementPoint.Value = temp;
// something like this doesnt work?
// RaisePropertyChanged(nameof(measurementPoint.Value));
}
}
The collection is defined as follows: ObservableCollection<MeasurementPoint> DataSet