May 2010
Intermediate to advanced
1272 pages
61h 18m
English
RectangleThe Rectangle element is another common geometric shape that you can utilize in custom control templates. Drawing a rectangle is easy, as demonstrated in the following code example:
![]()
You simply define its dimensions, specifying Stroke and StrokeThickness as for the ellipse (optional). Figure 32.16 shows how the object is drawn.
Figure 32.16 Drawing a rectangle.

Rectangle also has the RadiusX and RadiusY properties that you can assign to round corners.
Read now
Unlock full access