Example #1
0
        /// <summary>
        /// Draws a control's background.
        /// </summary>
        public static void DrawBackground(this SKCanvas canvas, Rectangle bounds, ControlStyle style)
        {
            var radius = style.Border.GetRadius();

            if (radius > 0)
            {
                canvas.Clear(SKColors.Transparent);
                canvas.FillRoundedRectangle(0, 0, bounds.Width - style.Border.GetWidth(), bounds.Height - style.Border.GetWidth(), style.GetBackgroundColor(), radius, radius, style.Border.GetWidth());
                return;
            }

            canvas.Clear(style.GetBackgroundColor());
        }
 public static void DrawBackground(this SKCanvas canvas, ControlStyle style) =>
 canvas.Clear(style.GetBackgroundColor());
Example #3
0
 /// <summary>
 /// Gets the computed background color.
 /// </summary>
 public SKColor GetBackgroundColor() => BackgroundColor ?? _parent? .GetBackgroundColor() ?? Theme.NeutralGray;
Example #4
0
 public SKColor GetBackgroundColor() => BackgroundColor ?? _parent.GetBackgroundColor();