In WPF, Prism v4, I have a ToolBar which acts as a region. In this region I inject UserControls which contains buttons and separators for the toolbar.
The problem is that because the buttons now lives in a UserControl, the toolbar styles no longer applies.
I could solve this by defining the styles:
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"/>
<Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"/>
But I would like to avoid this because I got hundreds of buttons. So my question is if I can define styles for all buttons under the ToolBar from a resource dictionary?
Thank you!
You can use something like:
If you put that in your ToolBar resources, then it will apply to any buttons inside it.