Basic Shapes

The simplest way to draw 2-D graphical content in a Silverlight user interface is to use shapes: dedicated classes that represent simple lines, ellipses, rectangles, and polygons. Technically, shapes are known as drawing primitives. You can combine these basic ingredients to create more complex graphics.

The most important detail about shapes in Silverlight is that they all derive from FrameworkElement. As a result, shapes are elements. This has a number of important consequences:

  • Shapes draw themselves: You don't need to manage the invalidation and painting process. For example, you don't need to manually repaint a shape when content moves, the page is resized, or the shape's properties change.
  • Shapes are organized in the same ...

Get Pro Silverlight 5 in VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.