public static void DrawProgress(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, Slider view) { var slider = control as SliderHandler; var progress = view?.GetPercent() ?? 0; slider?.DrawProgress(canvas, progress, hPadding, dirtyRect); }
public static void DrawProgress(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, ProgressBar view) { var slider = control as ProgressBarHandler; var progress = view?.Value?.CurrentValue ?? 0; slider?.DrawProgress(canvas, progress, hPadding, dirtyRect); }
public static void DrawOverlay(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, View view) { var shape = control.GetOverlay(); if (shape == null) { return; } control?.DrawOverlay(canvas, shape, dirtyRect); }
public static void ClipCanvas(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, View view) { var border = control?.GetBorder(); var clipShape = control?.GetClipShape() ?? border; if (clipShape != null) { canvas.ClipPath(clipShape.PathForBounds(dirtyRect).ToSKPath()); } }
protected bool DrawLayer(string key, SKCanvas canvas, RectangleF dirtyRect, SkiaControl viewHandler, TVirtualView virtualView) { if (this.TryGetValue(key, out var action)) { action?.Invoke(canvas, dirtyRect, viewHandler, virtualView); return(true); } else { return(_chained?.DrawLayer(key, canvas, dirtyRect, viewHandler, virtualView) ?? false); } }
public static void DrawText(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, View view) { var textHandler = control as ITextHandler; if (textHandler == null) { return; } if (textHandler.TextBlock == null) { textHandler.TextBlock = textHandler.CreateTextBlock(); } control?.DrawText(textHandler.TextBlock, canvas, textHandler.VerticalAlignment); }
public bool DrawLayer(SKCanvas canvas, RectangleF dirtyRect, SkiaControl viewHandler, TVirtualView virtualView, string property) { if (virtualView == null) { return(false); } if (TryGetValue(property, out var updater)) { updater.Invoke(canvas, dirtyRect, viewHandler, virtualView); return(true); } return(_chained?.DrawLayer(canvas, dirtyRect, viewHandler, virtualView, property) ?? false); }
public static void DrawTrack(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, Slider view) { var slider = control as SliderHandler; slider?.DrawTrack(canvas, hPadding, dirtyRect); }
public static void DrawTrack(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, Toggle view) { var slider = control as ToggleHandler; slider?.DrawTrack(canvas, dirtyRect); }
public static void DrawBackground(SKCanvas canvas, RectangleF dirtyRect, SkiaControl control, View view) { control?.DrawBackground(canvas, control.GetBackgroundColor(Color.Transparent), dirtyRect); }