title: How to base a style on another style in a resource dictionary?
body: <p>I have a theme that is applied to all buttons in a resource dictionary. Now I want to add a trigger to the button while inheriting the style changes from the dictionary. I tried the following code, but it says that the control cannot be found. How can I fix it ? </p>
  
  <pre><code>&lt;UserControl.Resources&gt;
    &lt;ResourceDictionary&gt;
        &lt;ResourceDictionary.MergedDictionaries&gt;
            &lt;ResourceDictionary Source="Theme.xaml"/&gt;
        &lt;/ResourceDictionary.MergedDictionaries&gt;
  
        &lt;conv:ErrorContentConverter x:Key="ErrorContentConverter" /&gt;
  
        &lt;Style x:Key="ValidTrigger" 
               TargetType="Control" BasedOn="{StaticResource {x:Type Control}}"&gt;
           &lt;Style.Triggers&gt;
              &lt;DataTrigger Binding="{Binding Path=IsValid}" Value="False"&gt;
                &lt;Setter Property="IsEnabled" Value="false" /&gt;
              &lt;/DataTrigger&gt;
           &lt;/Style.Triggers&gt;
        &lt;/Style&gt;   
    &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>The base template: </p>
  
  <pre><code>    &lt;Style TargetType="{x:Type Button}" BasedOn="{x:Null}"&gt;
      &lt;Setter Property="FocusVisualStyle" 
              Value="{DynamicResource NuclearButtonFocusVisual}" /&gt;
      &lt;Setter Property="Foreground" Value="#FF042271" /&gt;
      &lt;Setter Property="FontFamily" Value="Trebuchet MS" /&gt;
      &lt;Setter Property="FontSize" Value="12" /&gt;
      &lt;Setter Property="Padding" Value="3" /&gt;
  
      &lt;Setter Property="Template" Value="{DynamicResource ButtonTemplate}" /&gt;
  &lt;/Style&gt;
  </code></pre>