daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class MeasurementPoint : ModelBase
  2. {
  3.     private double _value;
  4.     public double Value
  5.     {
  6.         get { return _value; }
  7.         set
  8.         {
  9.             _value = value;
  10.             NotifyPropertyChanged();
  11.         }
  12.     }
  13. }
  14.    
  15. private void RefreshDataGridTolerance()
  16. {
  17.     foreach (var measurementPoint in DataSet)
  18.     {
  19.         //TODO: Change this into a real way to raiseproperty changed without actually changing the value
  20.         var temp = measurementPoint.Value;
  21.         measurementPoint.Value = temp;
  22.  
  23.         // something like this doesnt work?
  24.         // RaisePropertyChanged(nameof(measurementPoint.Value));
  25.     }
  26. }
  27.    
  28. public class MeasurementPoint : ModelBase
  29. {
  30.   //...
  31.   public void RefreshAllProperties()
  32.   {
  33.     foreach(var prop in this.GetType().GetProperties())
  34.       this.OnPropertyChanged(prop.Name);
  35.   }
  36. }
  37.    
  38. var element = DataSet.First();
  39. element.RefreshAllProperties();
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top