O'Reilly logo

Windows Presentation Foundation 4.5 Cookbook by Pavel Yosifovich

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

Creating a custom shape

Shapes are (mostly) simple elements deriving from the Shape abstract base class, which derives directly from FrameworkElement; shapes providing an inherent graphical representation that can easily be filled, stroked and stretched. Shapes are not controls they have no template associated with them. They are, however, full elements, providing support for the full range of capabilities, including participation in layout, hit testing, and the multitude of properties and events that make working with these entities as easy as any control.

We can create new shapes by deriving from Shape, providing a new graphical representation, and taking advantage of the functionality provided by the base Shape class.

Getting ready

Make sure ...

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