Using XAML Resource Dictionary

Mar 12, 2016 at 9:12 AM

I am launching a Window from the Ribbon and the window contains WPF code. When I style elements (say a button) in the xaml of the control it works fine, but when I try to include the same style as a resource dictionary to be used for all buttons launched in the addin it is ignored.

Is it possible to do this, i.e. to use resource dictionaries to style WPF code from within the addin, and if so how?

I defined a stand-alone xaml ResourceDictionary with a simple style as below, and set the xaml file as 'Embedded Resource". But the buttons don't get styled.
<ResourceDictionary xmlns=""

    <Style TargetType="Button">
        <Setter Property="BorderBrush" Value="Red"/>
        <Setter Property="BorderThickness" Value="2"/>