How can I create a style that only exists within the context of a ResourceDictionary, but not in the context of controls that include that ResourceDictionary?
For in
One way to get quite close to what you are looking for is to move the "private" styles from ControlTemplates.xaml
into their own ResourceDictionary
, and then reference that resource dictionary from within the control templates in ControlTemplates.xaml:
ControlTemplates.xaml:
ControlTemplatePrivateStyles.xaml:
Then the xaml for the window would look like this:
This way you could not use the "private" styles unless you explicitly reference that resource dictionary. They will not be accessible by just referncing the ControlTemplates.xaml resource dictionary.