コード例 #1
0
        protected override void RenderAttributes(AttributesBuilder builder)
        {
            base.RenderAttributes(builder);

            if (BackgroundGradientAngle != null)
            {
                builder.AddAttribute(nameof(BackgroundGradientAngle), BackgroundGradientAngle.Value);
            }
            if (BackgroundGradientEndColor != null)
            {
                builder.AddAttribute(nameof(BackgroundGradientEndColor), AttributeHelper.ColorToString(BackgroundGradientEndColor.Value));
            }
            if (BackgroundGradientStartColor != null)
            {
                builder.AddAttribute(nameof(BackgroundGradientStartColor), AttributeHelper.ColorToString(BackgroundGradientStartColor.Value));
            }
            //IEnumerable<GradientStop> BackgroundGradientStops
            if (BorderColor != null)
            {
                builder.AddAttribute(nameof(BorderColor), AttributeHelper.ColorToString(BorderColor.Value));
            }
            if (BorderDrawingStyle != null)
            {
                builder.AddAttribute(nameof(BorderDrawingStyle), (int)BorderDrawingStyle.Value);
            }
            if (BorderGradientAngle != null)
            {
                builder.AddAttribute(nameof(BorderGradientAngle), BorderGradientAngle.Value);
            }
            if (BorderGradientEndColor != null)
            {
                builder.AddAttribute(nameof(BorderGradientEndColor), AttributeHelper.ColorToString(BorderGradientEndColor.Value));
            }
            if (BorderGradientStartColor != null)
            {
                builder.AddAttribute(nameof(BorderGradientStartColor), AttributeHelper.ColorToString(BorderGradientStartColor.Value));
            }
            //IEnumerable<GradientStop> BorderGradientStops
            if (BorderIsDashed != null)
            {
                builder.AddAttribute(nameof(BorderIsDashed), BorderIsDashed.Value);
            }
            if (BorderThickness != null)
            {
                builder.AddAttribute(nameof(BorderThickness), AttributeHelper.SingleToString(BorderThickness.Value));
            }
            if (CornerRadius != null)
            {
                builder.AddAttribute(nameof(CornerRadius), AttributeHelper.CornerRadiusToString(CornerRadius.Value));
            }
            if (Elevation != null)
            {
                builder.AddAttribute(nameof(Elevation), Elevation.Value);
            }
            if (HasShadow != null)
            {
                builder.AddAttribute(nameof(HasShadow), HasShadow.Value);
            }
            if (OffsetAngle != null)
            {
                builder.AddAttribute(nameof(OffsetAngle), AttributeHelper.DoubleToString(OffsetAngle.Value));
            }
            if (Sides != null)
            {
                builder.AddAttribute(nameof(Sides), Sides.Value);
            }
        }
コード例 #2
0
        protected override void RenderAttributes(AttributesBuilder builder)
        {
            base.RenderAttributes(builder);

            if (Aspect != null)
            {
                builder.AddAttribute(nameof(Aspect), (int)Aspect.Value);
            }
            if (BitmapOptimizations != null)
            {
                builder.AddAttribute(nameof(BitmapOptimizations), BitmapOptimizations.Value);
            }
            if (CacheDuration != null)
            {
                builder.AddAttribute(nameof(CacheDuration), CacheDuration.Value);
            }
            //if (CacheKeyFactory != null)
            //{
            //    builder.AddAttribute(nameof(CacheKeyFactory), CacheKeyFactory);
            //}
            if (CacheType != null)
            {
                builder.AddAttribute(nameof(CacheType), CacheType.Value);
            }
            //if (CustomDataResolver != null)
            //{
            //    builder.AddAttribute(nameof(CustomDataResolver), CustomDataResolver);
            //}
            if (DownsampleHeight != null)
            {
                builder.AddAttribute(nameof(DownsampleHeight), AttributeHelper.DoubleToString(DownsampleHeight.Value));
            }
            if (DownsampleToViewSize != null)
            {
                builder.AddAttribute(nameof(DownsampleToViewSize), DownsampleToViewSize.Value);
            }
            if (DownsampleUseDipUnits != null)
            {
                builder.AddAttribute(nameof(DownsampleUseDipUnits), DownsampleUseDipUnits.Value);
            }
            if (DownsampleWidth != null)
            {
                builder.AddAttribute(nameof(DownsampleWidth), AttributeHelper.DoubleToString(DownsampleWidth.Value));
            }
            if (ErrorPlaceholder != null)
            {
                builder.AddAttribute(nameof(ErrorPlaceholder), AttributeHelper.ImageSourceToString(ErrorPlaceholder));
            }
            if (FadeAnimationDuration != null)
            {
                builder.AddAttribute(nameof(FadeAnimationDuration), FadeAnimationDuration.Value);
            }
            if (FadeAnimationEnabled != null)
            {
                builder.AddAttribute(nameof(FadeAnimationEnabled), FadeAnimationEnabled.Value);
            }
            if (FadeAnimationForCachedImages != null)
            {
                builder.AddAttribute(nameof(FadeAnimationForCachedImages), FadeAnimationForCachedImages.Value);
            }
            //if (FixedAndroidMotionEventHandler != null)
            //{
            //    builder.AddAttribute(nameof(FixedAndroidMotionEventHandler), FixedAndroidMotionEventHandler.Value);
            //}
            //if (FixedOnMeasureBehavior != null)
            //{
            //    builder.AddAttribute(nameof(FixedOnMeasureBehavior), FixedOnMeasureBehavior.Value);
            //}
            if (InvalidateLayoutAfterLoaded != null)
            {
                builder.AddAttribute(nameof(InvalidateLayoutAfterLoaded), InvalidateLayoutAfterLoaded.Value);
            }
            if (IsOpaque != null)
            {
                builder.AddAttribute(nameof(IsOpaque), IsOpaque.Value);
            }
            if (LoadingDelay != null)
            {
                builder.AddAttribute(nameof(LoadingDelay), LoadingDelay.Value);
            }
            if (LoadingPlaceholder != null)
            {
                builder.AddAttribute(nameof(LoadingPlaceholder), AttributeHelper.ImageSourceToString(LoadingPlaceholder));
            }
            if (LoadingPriority != null)
            {
                builder.AddAttribute(nameof(LoadingPriority), (int)LoadingPriority.Value);
            }
            if (RetryCount != null)
            {
                builder.AddAttribute(nameof(RetryCount), RetryCount.Value);
            }
            if (RetryDelay != null)
            {
                builder.AddAttribute(nameof(RetryDelay), RetryDelay.Value);
            }
            if (Source != null)
            {
                builder.AddAttribute(nameof(Source), AttributeHelper.ImageSourceToString(Source));
            }
            //if (Transformations != null)
            //{
            //    builder.AddAttribute(nameof(Transformations), Transformations);
            //}
            if (TransformPlaceholders != null)
            {
                builder.AddAttribute(nameof(TransformPlaceholders), TransformPlaceholders.Value);
            }

            RenderAdditionalAttributes(builder);
        }