I suppose I understand what you are asking. Let's start that using them in a ResourceDictionary
is perfectly fine, and might be ideal. The second, most obvious use, would be to put them in a UserControl
. Both options would allow you to reuse them however you want.
Let's pretend I had a Canvas
and I wanted to do just that.
<Canvas Height="100" Width="100" Background="Blue" />
Now, to use a ResourceDictionary, I would do this:
<Grid>
<Grid.Resources>
<DataTemplate x:Name="MyShape">
<Canvas Height="100" Width="100" Background="Red" />
</DataTemplate>
</Grid.Resources>
<ContentPresenter Content="{x:Null}" ContentTemplate="{StaticResource MyShape}" />
</Grid>
Note you can remove this from
Resources
and move it to a file if you like.
And, if you want a user control which gives you advantage of code-behind, you can do that, too.
Best of luck.