private ReportCellProperty GetCellProperty(AttributeBase attribute) { ReportCellProperty property = null; switch (attribute) { case AlignmentAttribute alignmentAttribute: property = new AlignmentProperty(alignmentAttribute.Alignment); break; case BoldAttribute _: property = new BoldProperty(); break; case ColorAttribute colorAttribute: property = new ColorProperty(colorAttribute.FontColor, colorAttribute.BackgroundColor); break; case DateTimeFormatAttribute dateTimeFormatAttribute: property = new DateTimeFormatProperty(dateTimeFormatAttribute.Format); break; case DecimalPrecisionAttribute decimalPrecisionAttribute: property = new DecimalPrecisionProperty(decimalPrecisionAttribute.Precision); break; case MaxLengthAttribute maxLengthAttribute: property = new MaxLengthProperty(maxLengthAttribute.MaxLength); break; case PercentFormatAttribute percentFormatAttribute: property = new PercentFormatProperty(percentFormatAttribute.Precision) { PostfixText = percentFormatAttribute.PostfixText, }; break; } return(property); }
set => SetValue(MaxLengthProperty, value);
set => this.SetValue(MaxLengthProperty, value);
set => base.SetValue(MaxLengthProperty, value);
static ByteUpDown() { UpdateMetadata(typeof(ByteUpDown), ( byte )1, byte.MinValue, byte.MaxValue); MaxLengthProperty.OverrideMetadata(typeof(ByteUpDown), new FrameworkPropertyMetadata(3)); }