コード例 #1
0
 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();
             }
         };
     }
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 public RaceCounterViewModel(IRaceCounter counter) : this()
 {
     Model = counter;
 }