public SimpleBinding(IValueHolder <TValueType> dataTarget, IBindableControl <TValueType> widgetTarget) { _dataTarget = dataTarget; _dataTarget.PropertyChanged += OnDataPropertyChanged; _widget = widgetTarget; _widget.ValueChanged += OnWidgetValueChanged; _widget.GoingAway += _target_HandleDestroyed; //Debug.WriteLine("++++++Constructed SimpleBinding boundTo: " + this._widget.Value); }
protected void ExtractValues(IOrderedDictionary dictionary, Control container) { IBindableControl control = container as IBindableControl; if (control != null) { control.ExtractValues(dictionary); } foreach (Control c in container.Controls) { ExtractValues(dictionary, c); } }
internal static void ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container) { IBindableControl bindableControl = container as IBindableControl; if (bindableControl != null) { bindableControl.ExtractValues(dictionary); } foreach (Control childControl in container.Controls) { ExtractValuesFromBindableControls(dictionary, childControl); } }
/// <summary> /// Drop our connections to everything so garbage collection can happen and we aren't /// a zombie responding to data change events. /// </summary> private void TearDown() { // Debug.WriteLine("-----TearDown SimpleBinding boundTo: " + this._widget.Value); if (_dataTarget == null) { return; //teardown was called twice } _dataTarget.PropertyChanged -= OnDataPropertyChanged; _dataTarget = null; _widget.ValueChanged -= OnWidgetValueChanged; _widget.GoingAway -= _target_HandleDestroyed; _widget = null; }
public void Bind(IBindableControl bindableControl, string propertyName) { MethodInvoker invoker1 = null; EventHandler handler1 = null; MethodInvoker invoker2 = null; EventHandler handler2 = null;