public static float GetX(this SKVisualElement childView) { var x = childView.X; var parent = childView.Parent; while (parent != null) { x += parent.X; parent = parent.Parent; } return(x); }
public static float GetY(this SKVisualElement childView) { var y = childView.Y; var parent = childView.Parent; while (parent != null) { y += parent.Y; parent = parent.Parent; } return(y); }
public static SKVisualElement ToSKVisualElement(this View element) { var visualElement = new SKVisualElement((float)element.X, (float)element.Y, (float)element.Width, (float)element.Height, element.Margin); switch (element) { case BoxView boxView: visualElement.CornerRadius = boxView.CornerRadius; break; case Frame frame: visualElement.CornerRadius = new CornerRadius(frame.CornerRadius); break; } return(visualElement); }