public void SetTarget(IRaceCounter <T> counter) { targetCounter = counter; if (targetCounter is INotifyPropertyChanged) { var notify = targetCounter as INotifyPropertyChanged; notify.PropertyChanged += (sender, e) => { if (e.PropertyName == "Value") { targetChangesCounter++; Invalidate(); } }; } }
public void SetBase(IRaceCounter <T> counter) { baseCounter = counter; if (baseCounter is INotifyPropertyChanged) { var notify = baseCounter as INotifyPropertyChanged; notify.PropertyChanged += (sender, e) => { if (e.PropertyName == "Value") { baseChangesCounter++; Invalidate(); } }; } Invalidate(); }
public RaceCounterViewModel(IRaceCounter counter) : this() { Model = counter; }