Пример #1
0
 /// <summary>
 /// Binds to INotifyElementChanged.ElementChanged on the value set in memberValue, if supported.
 /// </summary>
 public void BindToElementChanged()
 {
     if (!_elementChangedBound)
     {
         INotifyAsChanged changeAwareValue = _memberValue as INotifyAsChanged;
         if (changeAwareValue != null)
         {
             changeAwareValue.HasBeenChanged += new EventHandler(_memberValue_ElementChanged);
             _elementChangedBound             = true;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Binds to INotifyElementChanged.ElementChanged on the value set in memberValue, if supported.
 /// </summary>
 public void BindToElementChanged()
 {
     if (!_elementChangedBound)
     {
         INotifyAsChanged changeAwareValue = _memberValue as INotifyAsChanged;
         if (changeAwareValue != null)
         {
             changeAwareValue.HasBeenChanged += _sharedValueChangedHandler;
             _elementChangedBound             = true;
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Unbinds from the ElementChanged event
 /// </summary>
 public void UnbindFromElementChanged()
 {
     if (_elementChangedBound)
     {
         INotifyAsChanged changeAwareValue = _memberValue as INotifyAsChanged;
         if (changeAwareValue != null)
         {
             changeAwareValue.HasBeenChanged -= new EventHandler(_memberValue_ElementChanged);
             _elementChangedBound             = false;
         }
     }
 }
Пример #4
0
 /// <summary>
 /// Binds to INotifyElementChanged.ElementChanged on the value set in memberValue, if supported.
 /// </summary>
 public void BindToElementChanged()
 {
     if (!_elementChangedBound && typeof(INotifyAsChanged).IsAssignableFrom(typeof(TValue)))
     {
         INotifyAsChanged changeAwareValue = (INotifyAsChanged)_memberValue;
         if (changeAwareValue != null)
         {
             changeAwareValue.HasBeenChanged += this.SharedValueChangedHandler;
             _elementChangedBound             = true;
         }
     }
 }