Ejemplo n.º 1
0
        public static Binding GetTwoWayBinding(Control bindingControl,
                                               string propertyName,
                                               INotifyPropertyChanged bindingSource,
                                               string dataMember)
        {
            AsyncBindingHelper helper
                = new AsyncBindingHelper(bindingControl, bindingSource, dataMember, "Value2");

            return(new Binding(propertyName, helper, helper.helperPropertyName));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get a binding instance that can invoke a property change
        /// on the UI thread, regardless of the originating thread
        /// </summary>
        /// <param name="bindingControl">The UI control this binding is added to</param>
        /// <param name="propertyName">The property on the UI control to bind to</param>
        /// <param name="bindingSource">The source INotifyPropertyChanged to be
        /// observed for changes</param>
        /// <param name="dataMember">The property on the source to watch</param>
        /// <returns></returns>
        public static Binding GetOneWayBinding(Control bindingControl,
                                               string propertyName,
                                               INotifyPropertyChanged bindingSource,
                                               string dataMember)
        {
            AsyncBindingHelper helper
                = new AsyncBindingHelper(bindingControl, bindingSource, dataMember, "Value1");

            return(new Binding(propertyName, helper, helper.helperPropertyName));  //this create a binding between bindingControl.propertyName and helper.dataMember
        }