public static GradientDrawable.Orientation ToAndroid(this AngleGradient angleGradient) { switch (angleGradient) { case AngleGradient.BottomLeftTopRight: return(GradientDrawable.Orientation.BlTr); case AngleGradient.BottomRightTopLeft: return(GradientDrawable.Orientation.BrTl); case AngleGradient.BottomTop: return(GradientDrawable.Orientation.BottomTop); case AngleGradient.LeftRight: return(GradientDrawable.Orientation.LeftRight); case AngleGradient.RightLeft: return(GradientDrawable.Orientation.RightLeft); case AngleGradient.TopBottom: return(GradientDrawable.Orientation.TopBottom); case AngleGradient.TopLeftBottomRight: return(GradientDrawable.Orientation.TlBr); case AngleGradient.TopRightBottomLeft: return(GradientDrawable.Orientation.TrBl); default: return(GradientDrawable.Orientation.LeftRight); } }
public static Point[] ToWindows(this AngleGradient angleGradient) { switch (angleGradient) { case AngleGradient.BottomLeftTopRight: return(new Point[] { new Point(0, 0), new Point(1, 1) }); case AngleGradient.BottomRightTopLeft: return(new Point[] { new Point(1, 0), new Point(0, 1) }); case AngleGradient.BottomTop: return(new Point[] { new Point(0, 0), new Point(0, 1) }); case AngleGradient.LeftRight: return(new Point[] { new Point(0, 0), new Point(1, 0) }); case AngleGradient.RightLeft: return(new Point[] { new Point(1, 0), new Point(0, 0) }); case AngleGradient.TopBottom: return(new Point[] { new Point(0, 1), new Point(0, 0) }); case AngleGradient.TopLeftBottomRight: return(new Point[] { new Point(1, 0), new Point(0, 1) }); case AngleGradient.TopRightBottomLeft: return(new Point[] { new Point(1, 1), new Point(0, 0) }); default: return(new Point[] { new Point(0, 0), new Point(1, 0) }); } }