public override bool ShouldSerializeValue(object component) { bool?serializeFromRadobject = this.GetShouldSerializeFromRadobject(component); if (serializeFromRadobject.HasValue && serializeFromRadobject.HasValue) { return(serializeFromRadobject.Value); } RadObject component1 = (RadObject)component; RadProperty radProperty = this.GetRadProperty(component1); RadPropertyValue propertyValue = component1.GetPropertyValue(radProperty); if (propertyValue == null || propertyValue.ValueSource != ValueSource.Local && propertyValue.ValueSource != ValueSource.LocalFromBinding) { return(false); } if (radProperty == RadElement.BoundsProperty) { return(!(bool)component1.GetValue(RadElement.AutoSizeProperty)); } if (propertyValue.IsSetAtDesignTime) { return(true); } return(this.Wrapped.ShouldSerializeValue(component)); }
protected internal override object GetDefaultValue( RadPropertyValue propVal, object baseDefaultValue) { RadProperty property = propVal.Property; if (property == VisualElement.ForeColorProperty) { return((object)SystemColors.ControlDarkDark); } if (property == RadElement.AutoSizeModeProperty) { return((object)RadAutoSizeMode.Auto); } if (property == RadElement.FitToSizeModeProperty) { return((object)RadFitToSizeMode.FitToParentBounds); } if (property != VisualElement.SmoothingModeProperty) { return(base.GetDefaultValue(propVal, baseDefaultValue)); } if (this.BoxStyle == BorderBoxStyle.FourBorders && this.GetCurrentShape() == null) { return((object)SmoothingMode.Default); } return((object)SmoothingMode.AntiAlias); }
protected internal override object GetDefaultValue(RadPropertyValue propVal, object baseDefaultValue) { RadProperty property = propVal.Property; if (property == ForeColorProperty) { return(SystemColors.ControlDarkDark); } if (property == AutoSizeModeProperty) { return(RadAutoSizeMode.Auto); } if (property == FitToSizeModeProperty) { return(RadFitToSizeMode.FitToParentBounds); } if (property == SmoothingModeProperty) { return(SmoothingMode.AntiAlias); } return(base.GetDefaultValue(propVal, baseDefaultValue)); }
protected override ValueUpdateResult SetValueCore( RadPropertyValue propVal, object propModifier, object newValue, ValueSource source) { if (propVal.Property == RadElement.ShapeProperty && newValue != null && !(newValue is RoundRectShape)) { return(ValueUpdateResult.Canceled); } return(base.SetValueCore(propVal, propModifier, newValue, source)); }
protected override ValueUpdateResult SetValueCore(RadPropertyValue propVal, object propModifier, object newValue, ValueSource source) { //Do not allow the update of the following properties unless the value source is DefaultValueOverride. if (source != ValueSource.DefaultValueOverride && (propVal.Property == RadPageViewStackElement.StackPositionProperty || propVal.Property == RadPageViewStackElement.ItemSelectionModeProperty || propVal.Property == RadPageViewElement.ItemContentOrientationProperty)) { return(ValueUpdateResult.Canceled); } return(base.SetValueCore(propVal, propModifier, newValue, source)); }
protected override object CoerceValue(RadPropertyValue propVal, object baseValue) { if (propVal.Property != RadMenuItem.DescriptionTextVisibleProperty) { return(base.CoerceValue(propVal, baseValue)); } if (this.Layout != null && this.Layout.Description != null) { return((object)(this.Layout.Description.Text != string.Empty)); } return((object)false); }
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); }
protected internal override object CoerceValue(RadPropertyValue propVal, object baseValue) { if (propVal.Property == DescriptionTextVisibleProperty) { if (this.Layout != null && this.Layout.Description != null) { return(this.Layout.Description.Text != string.Empty); } return(false); } return(base.CoerceValue(propVal, baseValue)); }
//protected override Type ThemeEffectiveType //{ // get // { // return typeof(RadPageViewStackElement); // } //} protected override ValueUpdateResult SetValueCore(RadPropertyValue propVal, object propModifier, object newValue, ValueSource source) { RadProperty property = propVal.Property; if (property == RadPageViewStackElement.ItemSelectionModeProperty && (StackViewItemSelectionMode)newValue != StackViewItemSelectionMode.ContentAfterSelected) { return(ValueUpdateResult.Canceled); } if (property == RadPageViewStackElement.StackPositionProperty && ((StackViewPosition)newValue == StackViewPosition.Bottom || (StackViewPosition)newValue == StackViewPosition.Right)) { return(ValueUpdateResult.Canceled); } return(base.SetValueCore(propVal, propModifier, newValue, source)); }
protected internal override object GetDefaultValue( RadPropertyValue propVal, object baseDefaultValue) { RadProperty property = propVal.Property; if (property == RadElement.AutoSizeModeProperty) { return((object)RadAutoSizeMode.Auto); } if (property == RadElement.FitToSizeModeProperty) { return((object)RadFitToSizeMode.FitToParentBounds); } if (property == VisualElement.SmoothingModeProperty) { return((object)SmoothingMode.AntiAlias); } return(base.GetDefaultValue(propVal, baseDefaultValue)); }
public override bool ShouldSerializeValue(object component) { bool?res = GetShouldSerializeFromRadobject(component); if (res != null && res.HasValue) { return(res.Value); } RadObject radObject = (RadObject)component; RadProperty property = this.GetRadProperty(radObject); RadPropertyValue propVal = radObject.GetPropertyValue(property); //no entry registered for this RadProperty if (propVal == null) { return(false); } //TODO: Research why the DefaultValueOverride is part of this condition? if (propVal.ValueSource == ValueSource.Local || propVal.ValueSource == ValueSource.LocalFromBinding) { if (property == RadElement.BoundsProperty) { return((bool)radObject.GetValue(RadElement.AutoSizeProperty) == false); } if (propVal.IsSetAtDesignTime) { return(true); } return(Wrapped.ShouldSerializeValue(component)); } //do not serialize value return(false); }