Hello, Is there a way to apply a style to all controls of the same type in one user control dynamically, without applying in all controls of my application and without go to the control and set the style manually?
EDIT The problem is that in my ResorceDictionary I have 2 styles, with the x:Key set
<Style x:Key="ScrollBar_White" TargetType="{x:Type ScrollBar}">
<Style x:Key="ScrollBar_Black" TargetType="{x:Type ScrollBar}">
And I want to know if there is a way in XAML to apply dynamically a named style without use the following code on all the scrollbars of my UserControl.
<ScrollBar Style="ScrollBar_White">
EDIT
I'm sorry, I'm new at WPF, so I'm missing to let you know somethings that are important (that I discover after applying your last solution). The last solution actually works if the styles are StaticResources, but they are DynamicResources and the BasedOn don't work well with DynamicResources.
Any Idea how to do this with DynamicResource?
Many thanks, and sorry I miss important points in my questions.