You can use the attached behavior to combine your resource dictionary into each window / page / usercontrol resource, for example:
<Page my:Skinlibrary.Attach="True">
</Page>
You can customize the attached behavior to always combine the same instance of the resource dictionary with the attached resources of the element. To do this, you need to initialize the resource dictionary only once, possibly in a static ctor.
Assuming you have ready-made resources in the variable "_staticResourceDictionaryThatHoldsMySkin", then in the "PropertyChanged" callback of the attached property, you can do this to combine it into the attached windows:
static void OnAttachChanged(DependencyProperty sender, DependencyPropertyChangedEventArgs e)
{
(sender as FrameworkElement).Resources.MergedDictionaries.Add(_staticResourceDictionaryThatHoldsMySkinResources);
}
, SkinLibrary. , .
, Visual Studio, 2008 , 2010 .