/// <summary> /// Callback for changes in the property given to the MonitorProperty(...) method. /// Used to print out all changes in the console. /// </summary> /// <param name="e">The callback arguments.</param> private static void PropertyChangeCallback(PropertyChangedCallbackArgs e) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("Property \"{0}\" of source \"{1}\" changed from ", e.Handle.Path, e.Handle.Source); if (e.OldValue != null) { sb.AppendFormat("\"{0}\"", e.OldValue.ToString()); } else { sb.Append("null"); } sb.Append(" to "); if (e.NewValue != null) { sb.AppendFormat("\"{0}\".", e.NewValue.ToString()); } else { sb.Append("null."); } Debug.WriteLine(sb.ToString()); }
public UniversalEventCallbackArgs(UniversalEventHandle handle, PropertyChangedCallbackArgs args) { if (handle == null) { throw new ArgumentNullException("handle"); } if (args == null) { throw new ArgumentNullException("args"); } this.Handle = handle; this.PropertyChangedCallbackArgs = args; }
/// <summary> /// Called when the source property's value changed. /// </summary> /// <param name="args">The PropertyChangedCallbackArgs.</param> private void OnSourceValueChanged(PropertyChangedCallbackArgs args) { this.UpdateTarget(); }
/// <summary> /// Initializes a new instance of the <see cref="CollectionObservationCallbackArgs"/> class. /// </summary> /// <param name="handle">The CollectionObservationHandle instance that is assiciated with the callback.</param> /// <param name="propertyChangedCallbackArgs">The PropertyChangedCallbackArgs instance that was caused by a property change.</param> public CollectionObservationCallbackArgs(CollectionObservationHandle handle, PropertyChangedCallbackArgs propertyChangedCallbackArgs) { this.ChangeType = ChangeType.PropertyChanged; this.Handle = handle; this.PropertyChangedCallbackArgs = propertyChangedCallbackArgs; }
/// <summary> /// Called when the monitored property changes its' value. /// </summary> /// <param name="e">The callback arguments of the property change.</param> private void OnMonitoredPropertyChanged(PropertyChangedCallbackArgs e) { this.UpdateCollectionChangedEventHandler(e.OldValue as INotifyCollectionChanged, e.NewValue as INotifyCollectionChanged); this.Callback(new CollectionObservationCallbackArgs(this, e)); }
private void OnPropertyChanged(PropertyChangedCallbackArgs args) { this.Callback(new UniversalEventCallbackArgs(this, args)); }
public void OnPropertyChanged(PropertyChangedCallbackArgs args) { this.Owner.OnPropertyChanged(this.Index, args.NewValue); }