Download source files - here

For example for following:
XAML:
<Button x:Key="ButtonPrototype" />
C#:
Resources["ButtonPrototype"];
- 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:XAML:
<Button x:Key="ButtonPrototype" x:Shared="False" />
C#
Resources["ButtonPrototype"]
PS: In my opinion last realization shares traits with Prototype Pattern.