void DrawFluentSliderTrackBackground(ICanvas canvas, RectangleF dirtyRect)
        {
            canvas.SaveState();

            if (IsEnabled)
            {
                canvas.FillColor = MaximumTrackColor.ToGraphicsColor(Fluent.Color.Primary.ThemeLight);
            }
            else
            {
                canvas.FillColor = ColorHelper.GetGraphicsColor(Fluent.Color.Background.NeutralLighter, Fluent.Color.Background.NeutralDark);
            }

            var x = dirtyRect.X;

            var width  = dirtyRect.Width - TextSize;
            var height = 4;

            var y = (float)((HeightRequest - height) / 2);

            canvas.FillRoundedRectangle(x, y, width, height, 0);

            canvas.RestoreState();

            _trackRect = new RectangleF(x, y, width, height);
        }
Exemple #2
0
        void DrawCupertinoSliderTrackBackground(ICanvas canvas, RectangleF dirtyRect)
        {
            canvas.SaveState();

            canvas.FillColor = MaximumTrackColor.ToGraphicsColor(DefaultCupertinoSliderTrackBackgroundColor);

            var x = dirtyRect.X;

            var width  = dirtyRect.Width;
            var height = 1;

            var y = (float)((HeightRequest - height) / 2);

            canvas.FillRoundedRectangle(x, y, width, height, 20);

            canvas.RestoreState();

            _trackRect = new RectangleF(x, y, width, height);
        }
Exemple #3
0
        void DrawMaterialSliderTrackBackground(ICanvas canvas, RectangleF dirtyRect)
        {
            canvas.SaveState();

            canvas.FillColor = MaximumTrackColor.ToGraphicsColor(Material.Color.LightBlue);

            var x = dirtyRect.X;

            var width  = dirtyRect.Width;
            var height = 2;

            var y = (float)((HeightRequest - height) / 2);

            canvas.FillRoundedRectangle(x, y, width, height, 0);

            canvas.RestoreState();

            _trackRect = new RectangleF(x, y, width, height);
        }