protected internal virtual ValueUpdateResult ResetValueCore( RadPropertyValue propVal, ValueResetFlags flags) { if (flags == ValueResetFlags.None) { return(ValueUpdateResult.NotUpdated); } object currentValue = propVal.GetCurrentValue(false); ValueSource valueSource = propVal.ValueSource; RadPropertyValue source = (RadPropertyValue)null; if (!propVal.IsCompositionLocked) { source = new RadPropertyValue(propVal); } propVal.BeginUpdate(true, false); if ((flags & ValueResetFlags.Animation) == ValueResetFlags.Animation) { int num1 = (int)this.SetValueCore(propVal, (object)null, (object)null, ValueSource.Animation); } if ((flags & ValueResetFlags.Local) == ValueResetFlags.Local) { int num2 = (int)this.SetValueCore(propVal, (object)null, RadProperty.UnsetValue, ValueSource.Local); } if ((flags & ValueResetFlags.DefaultValueOverride) == ValueResetFlags.DefaultValueOverride) { int num3 = (int)this.SetValueCore(propVal, (object)null, RadProperty.UnsetValue, ValueSource.DefaultValue); } if ((flags & ValueResetFlags.Binding) == ValueResetFlags.Binding) { int num4 = (int)this.SetValueCore(propVal, (object)null, (object)null, ValueSource.PropertyBinding); } if ((flags & ValueResetFlags.TwoWayBindingLocal) == ValueResetFlags.TwoWayBindingLocal) { int num5 = (int)this.SetValueCore(propVal, (object)null, RadProperty.UnsetValue, ValueSource.LocalFromBinding); } if ((flags & ValueResetFlags.Style) == ValueResetFlags.Style) { int num6 = (int)this.SetValueCore(propVal, (object)null, (object)null, ValueSource.Style); } if ((flags & ValueResetFlags.Inherited) == ValueResetFlags.Inherited) { int num7 = (int)this.SetValueCore(propVal, (object)null, RadProperty.UnsetValue, ValueSource.Inherited); } propVal.EndUpdate(true, false); if (propVal.IsCompositionLocked) { return(ValueUpdateResult.Updating); } ValueUpdateResult valueUpdateResult = this.RaisePropertyNotifications(propVal, currentValue, propVal.GetCurrentValue(true), valueSource); if (valueUpdateResult == ValueUpdateResult.Canceled) { propVal.Copy(source); } source?.Dispose(); return(valueUpdateResult); }
/// <summary> /// Resets the current value of the specified property using the provided flags. /// </summary> /// <param name="property">The RadProperty that should be reset.</param> /// <param name="flags">Additional flags that specify which effective modifiers should be reset.</param> /// <returns>The result of the operation.</returns> public ValueUpdateResult ResetValue(RadProperty property, ValueResetFlags flags) { RadPropertyValue propVal = this.propertyValues.GetEntry(property, false); if (propVal != null) { return(this.ResetValueCore(propVal, flags)); } return(ValueUpdateResult.NotUpdated); }
protected internal override ValueUpdateResult ResetValueCore( RadPropertyValue propVal, ValueResetFlags flags) { ValueUpdateResult valueUpdateResult = base.ResetValueCore(propVal, flags); if (propVal.Property == VisualElement.BackColorProperty && flags >= ValueResetFlags.Local) { this.UpdateAlternatingRowColor(); } return(valueUpdateResult); }
/// <summary> /// Resets the specified property value, using the provided reset flags. /// </summary> /// <param name="propVal"></param> /// <param name="flags"></param> /// <returns>The result of the operation.</returns> protected internal virtual ValueUpdateResult ResetValueCore(RadPropertyValue propVal, ValueResetFlags flags) { //no flags are specified if (flags == ValueResetFlags.None) { return(ValueUpdateResult.NotUpdated); } object oldValue = propVal.GetCurrentValue(false); ValueSource oldSource = propVal.ValueSource; RadPropertyValue oldState = null; //check whether we are in nested update block if (!propVal.IsCompositionLocked) { //create a copy of the current property value oldState = new RadPropertyValue(propVal); } propVal.BeginUpdate(true, false); //update property value as specified by the provided flags if ((flags & ValueResetFlags.Animation) == ValueResetFlags.Animation) { this.SetValueCore(propVal, null, null, ValueSource.Animation); } if ((flags & ValueResetFlags.Local) == ValueResetFlags.Local) { this.SetValueCore(propVal, null, RadProperty.UnsetValue, ValueSource.Local); } if ((flags & ValueResetFlags.DefaultValueOverride) == ValueResetFlags.DefaultValueOverride) { this.SetValueCore(propVal, null, RadProperty.UnsetValue, ValueSource.DefaultValue); } if ((flags & ValueResetFlags.Binding) == ValueResetFlags.Binding) { this.SetValueCore(propVal, null, null, ValueSource.PropertyBinding); } if ((flags & ValueResetFlags.TwoWayBindingLocal) == ValueResetFlags.TwoWayBindingLocal) { this.SetValueCore(propVal, null, RadProperty.UnsetValue, ValueSource.LocalFromBinding); } if ((flags & ValueResetFlags.Style) == ValueResetFlags.Style) { this.SetValueCore(propVal, null, null, ValueSource.Style); } if ((flags & ValueResetFlags.Inherited) == ValueResetFlags.Inherited) { this.SetValueCore(propVal, null, RadProperty.UnsetValue, ValueSource.Inherited); } propVal.EndUpdate(true, false); if (propVal.IsCompositionLocked) { return(ValueUpdateResult.Updating); } ValueUpdateResult result = this.RaisePropertyNotifications(propVal, oldValue, propVal.GetCurrentValue(true), oldSource); if (result == ValueUpdateResult.Canceled) { //restore previous state as operation was canceled propVal.Copy(oldState); } return(result); }
public void ResetValue(RadProperty property, ValueResetFlags flags) { int num = (int)this.stylePlaceholder.ResetValue(property, flags); this.UpdateItemStyle(); }