I am having problems expanding one of my styles that I defined in the Windows dictionary. Alone, it seems this style applies to my controls as expected. However, if you try to extend the style in one of my userControls using the basedOn property, it simply overrides the main one, and all the basic styles disappear. Here is an example:
In the resource dictionary called dict1.xaml:
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="Pink"/>
</Style>
In the main .xaml window:
<Window.Resources>
<ResourceDictionary Source="dict1.xaml"/>
</Window.Resources>
In the user control, userControl1.xaml:
<UserControl.Resources>
<Style BasedOn="{StaticResource {x:Type Button}}"
TargetType="{x:Type Button}">
<Setter Property="FontWeight" Value="Bold"/>
</Style>
</UserControl.Resources>
The style in the user control simply overrides the value in the resource dictionary, and the font is bold. If I delete the style in the user control, the dictionary style will start and the background will turn pink. I want both.
Any ideas what I'm doing wrong here?
.