Download source files - here
I often use a style&template that is magnificent possibility of WPF. It allows to define one style out of resources to many elements. I can easily define instance of some object in resources and extract it there where I require. But it has one limitation:
For example for following:
XAML:- returns always one instance (like Singlton Pattern). But what can I make if I require more than one such object? It isn't problem as XAML is very flexible and x:Shared attribute eliminates this trouble. Following code will extract various instances:
<Button x:Key="ButtonPrototype" />
<Button x:Key="ButtonPrototype" x:Shared="False" />
PS: In my opinion last realization shares traits with Prototype Pattern.