UserControl
derives from ContentControl
. It doesn't sounds as though you need content (the ability to host additional controls inside your shape), so I'd keep going up the hierarchy...
Here's a breakdown of the ancestry:
UserControl
ContentControl
Control
FrameworkElement
UIElement
Visual
...
Control
defines the Template
property, so I think the lightest means of achieving what you want is to use Control
:
<Control Style="{StaticResource MyStyle}"/>
...and use a Style
to set the template and any triggers/etc that you need.
If however you do need to host a child element inside your shape, you should use ContentControl
thus:
<ContentControl Style="{StaticResource MyStyle}"/>
If you find that this approach is too heavy-weight at runtime, then you might consider using Shape.
Shape
FrameworkElement
UIElement
Visual
...
Shape
does not inherit from Control
, but rather directly from FrameworkElement
. It is not templateable. It's an abstract class, of which you'd need to create your own custom subclass that knows how to describe its own presentation via the DefiningGeometry
property. This might be more complex than defining a style on a Control
, but if you need the extra performance then you may have to go this route.
EDIT You might like to check out DrawingVisual as well. From MSDN:
The DrawingVisual is a lightweight drawing class that is used to render shapes, images, or text. This class is considered lightweight because it does not provide layout or event handling, which improves its performance.
It also is not templateable, but if you need raw performance then it's worth a look.