Пример #1
0
        internal void OnPropertyUnboundExternally(PropertyBinding binding, RadObject boundObject)
        {
            if (this.IsDisposing)
            {
                return;
            }
            RadPropertyValue entry = this.propertyValues.GetEntry(binding.SourceProperty, false);

            if (entry == null)
            {
                return;
            }
            entry.BeginUpdate(true, false);
            entry.RemoveBoundObject(boundObject);
            if ((binding.BindingOptions & PropertyBindingOptions.TwoWay) == PropertyBindingOptions.TwoWay)
            {
                int num1 = (int)this.ResetValueCore(entry, ValueResetFlags.TwoWayBindingLocal);
            }
            if ((binding.BindingOptions & PropertyBindingOptions.PreserveAsLocalValue) == PropertyBindingOptions.PreserveAsLocalValue)
            {
                entry.SetLocalValue(binding.GetValue());
            }
            entry.EndUpdate(true, false);
            int num2 = (int)this.UpdateValueCore(entry);
        }
Пример #2
0
        /// <summary>
        /// Gets notified that the specified object has unbound itself from a property of ours.
        /// </summary>
        /// <param name="boundObject"></param>
        /// <param name="binding"></param>
        internal void OnPropertyUnboundExternally(PropertyBinding binding, RadObject boundObject)
        {
            if (this.IsDisposing)
            {
                return;
            }

            RadPropertyValue propVal = this.propertyValues.GetEntry(binding.SourceProperty, false);

            if (propVal == null)
            {
                return;
            }

            propVal.BeginUpdate(true, false);

            //remove previously registered relations
            propVal.RemoveBoundObject(boundObject);

            if ((binding.BindingOptions & PropertyBindingOptions.TwoWay) == PropertyBindingOptions.TwoWay)
            {
                //reset the local value applied from the two-way binding
                this.ResetValueCore(propVal, ValueResetFlags.TwoWayBindingLocal);
            }

            if ((binding.BindingOptions & PropertyBindingOptions.PreserveAsLocalValue) == PropertyBindingOptions.PreserveAsLocalValue)
            {
                propVal.SetLocalValue(binding.GetValue());
            }

            propVal.EndUpdate(true, false);
            this.UpdateValueCore(propVal);
        }