O'Reilly logo

Pro Silverlight 5 in VB by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required