title: How to change the dynamic resources in the button click?
body: <p>I am new to WPF i need to learn the static resources and dynamic resources, i have tried to set the Style for Button using Dynamic Resource and change the style using button click but style is not changed, please refer my below code i used for change the button style using click,</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;Style x:Key="Style1" TargetType="Button"&gt;
          &lt;Setter Property="Background" Value="Red" /&gt;
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;  
  &lt;Button x:Name="Content" Content="Content" Height="30" Width="200" Style="{DynamicResource ResourceKey=Style1}" Click="Content_Click" /&gt;   
  </code></pre>
  
  <p>Click :</p>
  
  <pre><code> private void Content_Click(object sender, RoutedEventArgs e)
   {
     this.Resources.Add("Style1", new SolidColorBrush(Colors.Blue));
   }    
  </code></pre>
  
  <p>Could you please any one guide me how to achieve my requirement?                   </p>