Пример #1
0
        public static void UpdateStrokeDashOffset(this AView platformView, IBorderStroke border)
        {
            MauiDrawable?mauiDrawable = platformView.Background as MauiDrawable;

            bool hasBorder = border.Shape != null && border.Stroke != null;

            if (mauiDrawable == null && !hasBorder)
            {
                return;
            }

            mauiDrawable?.SetBorderDash(border.StrokeDashPattern, border.StrokeDashOffset);
        }
Пример #2
0
        public static void UpdateStrokeDashPattern(this AView nativeView, IBorder border)
        {
            var          strokeDashPattern = border.StrokeDashPattern;
            MauiDrawable?mauiDrawable      = nativeView.Background as MauiDrawable;

            bool hasBorder = border.Shape != null && border.Stroke != null;

            if (mauiDrawable == null && !hasBorder && (strokeDashPattern == null || strokeDashPattern.Length == 0))
            {
                return;
            }

            mauiDrawable?.SetBorderDash(border.StrokeDashPattern, border.StrokeDashOffset);
        }