public static Polyline AddPolyline(this Canvas canvas, ShapeStyle shapeStyle, params Point[] points) { Polyline polyline = new Polyline(); foreach (var point in points) { polyline.Points.Add(point); } polyline.UpdateShape(shapeStyle); canvas.Children.Add(polyline); return(polyline); }
public static Ellipse AddEllipse(this Canvas canvas, double x, double y, double width, double height, ShapeStyle shapeStyle) { Ellipse ellipse = new Ellipse { Width = width, Height = height }; ellipse.UpdateShape(shapeStyle); Canvas.SetLeft(ellipse, x); Canvas.SetTop(ellipse, y); canvas.Children.Add(ellipse); return ellipse; }
public static Line AddLine(this Canvas canvas, double x1, double y1, double x2, double y2, ShapeStyle shapeStyle) { Line line = new Line() { X1 = x1, Y1 = y1, X2 = x2, Y2 = y2 }; line.UpdateShape(shapeStyle); canvas.Children.Add(line); return line; }
public static Ellipse AddEllipse(this Canvas canvas, Point point, Size size, ShapeStyle shapeStyle) { return AddEllipse(canvas, new Rect(point, size), shapeStyle); }
public static Rectangle AddRectangle(this Canvas canvas, Point point, Size size, ShapeStyle shapeStyle) { return AddRectangle(canvas, new Rect(point, size), shapeStyle); }
public static Rectangle AddRectangle(this Canvas canvas, double x, double y, double width, double height, ShapeStyle shapeStyle) { Rectangle rectangle = new Rectangle { Width = width, Height = height }; rectangle.UpdateShape(shapeStyle); Canvas.SetLeft(rectangle, x); Canvas.SetTop(rectangle, y); canvas.Children.Add(rectangle); return rectangle; }
public static Polyline AddPolyline(this Canvas canvas, ShapeStyle shapeStyle, params Point[] points) { Polyline polyline = new Polyline(); foreach (var point in points) { polyline.Points.Add(point); } polyline.UpdateShape(shapeStyle); canvas.Children.Add(polyline); return polyline; }
public static void UpdateShape(this Shape shape, ShapeStyle shapeStyle) { UpdateShape(shape, shapeStyle.StrokeStyle, shapeStyle.FillStyle); }
public static Line AddLine(this Canvas canvas, Point p1, Point p2, ShapeStyle shapeStyle) { return AddLine(canvas, p1.X, p1.Y, p2.X, p2.Y, shapeStyle); }
public static Ellipse AddEllipse(this Canvas canvas, Point point, Size size, ShapeStyle shapeStyle) { return(AddEllipse(canvas, new Rect(point, size), shapeStyle)); }
public static Ellipse AddEllipse(this Canvas canvas, double x, double y, double width, double height, ShapeStyle shapeStyle) { Ellipse ellipse = new Ellipse { Width = width, Height = height }; ellipse.UpdateShape(shapeStyle); Canvas.SetLeft(ellipse, x); Canvas.SetTop(ellipse, y); canvas.Children.Add(ellipse); return(ellipse); }
public static Rectangle AddRectangle(this Canvas canvas, double x, double y, double width, double height, ShapeStyle shapeStyle) { Rectangle rectangle = new Rectangle { Width = width, Height = height }; rectangle.UpdateShape(shapeStyle); Canvas.SetLeft(rectangle, x); Canvas.SetTop(rectangle, y); canvas.Children.Add(rectangle); return(rectangle); }
public static Line AddLine(this Canvas canvas, Point p1, Point p2, ShapeStyle shapeStyle) { return(AddLine(canvas, p1.X, p1.Y, p2.X, p2.Y, shapeStyle)); }
protected bool Equals(ShapeStyle other) { return(Equals(StrokeStyle, other.StrokeStyle) && Equals(FillStyle, other.FillStyle)); }
protected bool Equals(ShapeStyle other) { return Equals(StrokeStyle, other.StrokeStyle) && Equals(FillStyle, other.FillStyle); }
public static Ellipse AddEllipse(this Canvas canvas, Rect rect, ShapeStyle shapeStyle) { return AddEllipse(canvas, rect.Left, rect.Top, rect.Width, rect.Height, shapeStyle); }
public static Ellipse AddEllipse(this Canvas canvas, Rect rect, ShapeStyle shapeStyle) { return(AddEllipse(canvas, rect.Left, rect.Top, rect.Width, rect.Height, shapeStyle)); }
public static Line AddLine(this Canvas canvas, double x1, double y1, double x2, double y2, ShapeStyle shapeStyle) { Line line = new Line() { X1 = x1, Y1 = y1, X2 = x2, Y2 = y2 }; line.UpdateShape(shapeStyle); canvas.Children.Add(line); return(line); }
public static Polygon AddPolygon(this Canvas canvas, ShapeStyle shapeStyle, params Point[] points) { Polygon polygon = new Polygon(); foreach (var point in points) { polygon.Points.Add(point); } polygon.UpdateShape(shapeStyle); canvas.Children.Add(polygon); return polygon; }