Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
        }