示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
        /// <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;
        }
示例#5
0
 public void Bind(IBindableControl bindableControl, string propertyName)
 {
     MethodInvoker invoker1 = null;
     EventHandler  handler1 = null;
     MethodInvoker invoker2 = null;
     EventHandler  handler2 = null;