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

            if (IsEnabled)
            {
                canvas.FillColor = MinimumTrackColor.ToGraphicsColor(Fluent.Color.Primary.ThemePrimary);
            }
            else
            {
                canvas.FillColor = ColorHelper.GetGraphicsColor(Fluent.Color.Background.NeutralTertiaryAlt, Fluent.Color.Background.NeutralQuaternaryAlt);
            }

            var x = dirtyRect.X;

            var value = ((double)Value).Clamp(0, 1);
            var width = (float)((dirtyRect.Width - TextSize) * value);

            var height = 4;

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

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

            canvas.RestoreState();
        }
Пример #2
0
        void DrawCupertinoSliderTrackProgress(ICanvas canvas, RectangleF dirtyRect)
        {
            canvas.SaveState();

            canvas.FillColor = MinimumTrackColor.ToGraphicsColor(DefaultCupertinoSliderTrackProgressColor);

            var x = dirtyRect.X;

            var value = ((double)Value).Clamp(0, 1);
            var width = (float)(dirtyRect.Width * value);

            var height = 1;

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

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

            canvas.RestoreState();
        }
Пример #3
0
        protected virtual void DrawMaterialSliderTrackProgress(ICanvas canvas, RectangleF dirtyRect)
        {
            canvas.SaveState();

            canvas.FillColor = MinimumTrackColor.ToGraphicsColor(Material.Color.Blue);

            var x = dirtyRect.X;

            var value = ((double)Value).Clamp(0, 1);
            var width = (float)(dirtyRect.Width * value);

            var height = 2;

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

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

            canvas.RestoreState();
        }