protected virtual void BindColumnProperties()
        {
            PropertyBindingOptions options = PropertyBindingOptions.OneWay | PropertyBindingOptions.PreserveAsLocalValue;
            int num = (int)this.BindProperty(GridCellElement.PinPositionProperty, (RadObject)this.ColumnInfo, GridViewColumn.PinPositionProperty, options);

            this.ColumnInfo.RadPropertyChanged += new RadPropertyChangedEventHandler(this.ColumnInfo_RadPropertyChanged);
        }
Ejemplo n.º 2
0
        public ValueUpdateResult BindProperty(
            RadProperty propertyToBind,
            RadObject sourceObject,
            RadProperty sourceProperty,
            PropertyBindingOptions options)
        {
            if (sourceObject == null)
            {
                throw new ArgumentNullException("Binding source object");
            }
            if (sourceObject.IsDisposing || sourceObject.IsDisposed)
            {
                return(ValueUpdateResult.NotUpdated);
            }
            RadPropertyValue entry = this.propertyValues.GetEntry(propertyToBind, true);

            if (entry.PropertyBinding != null)
            {
                entry.BeginUpdate(true, false);
                int num = (int)this.ResetValueCore(entry, ValueResetFlags.Binding);
                entry.EndUpdate(true, false);
            }
            PropertyBinding   binding           = new PropertyBinding(sourceObject, propertyToBind, sourceProperty, options);
            ValueUpdateResult valueUpdateResult = this.SetValueCore(entry, (object)binding, (object)null, ValueSource.PropertyBinding);

            if ((options & PropertyBindingOptions.NoChangeNotify) == (PropertyBindingOptions)0)
            {
                sourceObject.OnPropertyBoundExternally(binding, this);
            }
            return(valueUpdateResult);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the RadPropertyBinding class.
 /// </summary>
 /// <param name="bindingSourceObject"></param>
 /// <param name="fromProperty"></param>
 /// <param name="bindingSourceProperty"></param>
 /// <param name="options"></param>
 public RadPropertyBinding(RadObject bindingSourceObject, RadProperty fromProperty, RadProperty bindingSourceProperty, PropertyBindingOptions options)
 {
     this.bindingSourceObject = bindingSourceObject;
     this.fromProperty        = fromProperty;
     this.toProperty          = bindingSourceProperty;
     this.options             = options;
 }
Ejemplo n.º 4
0
 public PropertyBinding(
     RadObject sourceObject,
     RadProperty boundProperty,
     RadProperty sourceProperty,
     PropertyBindingOptions options)
 {
     this.sourceObject   = new WeakReference((object)sourceObject);
     this.boundProperty  = boundProperty;
     this.sourceProperty = sourceProperty;
     this.options        = options;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Binds the specified property to a property of the provided binding source object.
        /// </summary>
        /// <param name="propertyToBind">Our property that is about to be bound.</param>
        /// <param name="sourceObject">The object to which source property belongs.</param>
        /// <param name="sourceProperty">The property to which we will bind.</param>
        /// <param name="options">Additional options, specifying the binding operation.</param>
        public ValueUpdateResult BindProperty(RadProperty propertyToBind, RadObject sourceObject,
                                              RadProperty sourceProperty, PropertyBindingOptions options)
        {
            if (sourceObject == null)
            {
                throw new ArgumentNullException("Binding source object");
            }
            if (sourceObject.IsDisposing || sourceObject.IsDisposed)
            {
                return(ValueUpdateResult.NotUpdated);
                //throw new ObjectDisposedException("Binding source object");
            }

            RadPropertyValue propVal = this.propertyValues.GetEntry(propertyToBind, true);

            //remove previous binding (if any)
            if (propVal.PropertyBinding != null)
            {
                //lock subsequent value updates
                propVal.BeginUpdate(true, false);
                this.ResetValueCore(propVal, ValueResetFlags.Binding);
                propVal.EndUpdate(true, false);
            }

            //create a new binding
            PropertyBinding binding = new PropertyBinding(sourceObject, propertyToBind, sourceProperty, options);
            //apply binding
            ValueUpdateResult result = this.SetValueCore(propVal, binding, null, ValueSource.PropertyBinding);

            if ((options & PropertyBindingOptions.NoChangeNotify) == 0)
            {
                //register ourselves as bound for source's property
                sourceObject.OnPropertyBoundExternally(binding, this);
            }

            return(result);
        }
 public virtual void BindRowProperties()
 {
     PropertyBindingOptions options = PropertyBindingOptions.TwoWay | PropertyBindingOptions.PreserveAsLocalValue;
     int num = (int)this.expander.BindProperty(ExpanderItem.ExpandedProperty, (RadObject)this.ItemElement, GanttViewTextItemElement.IsExpandedProperty, options);
 }
Ejemplo n.º 7
0
 public virtual void BindRowProperties()
 {
     PropertyBindingOptions options = PropertyBindingOptions.TwoWay | PropertyBindingOptions.PreserveAsLocalValue;
     int num = (int)this.expander.BindProperty(Telerik.WinControls.UI.ExpanderItem.ExpandedProperty, (RadObject)this.RowElement, GridDataRowElement.IsExpandedProperty, options);
 }
Ejemplo n.º 8
0
 protected override void BindColumnProperties()
 {
     base.BindColumnProperties();
     PropertyBindingOptions options = PropertyBindingOptions.OneWay;
     int num = (int)this.BindProperty(GridCellElement.FormatStringProperty, (RadObject)this.ColumnInfo, GridViewDataColumn.FormatStringProperty, options);
 }