/// <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; } } }
/// <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; } } }
/// <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; } } }
/// <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; } } }