title: change setter value in style
body: <p>I'm programming in WPF(c#). I'm trying to change value in a setter of style.</p>
  
  <p>my style is:</p>
  
  <pre><code>&lt;Style TargetType="Control" x:Key="st"&gt;
      &lt;Setter Property="FontFamily" Value="Tahoma"/&gt;
      &lt;Setter Property="FontSize" Value="14"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>and I use it in a button:</p>
  
  <pre><code>&lt;Button x:Name="btnCancel" Style="{StaticResource st}" Content="انصراف" Canvas.Left="30" Canvas.Top="18" Width="139" Height="53" FontFamily="2  badr" FlowDirection="LeftToRight" Click="btnCancel_Click_1" /&gt;
  </code></pre>
  
  <p>and what I try to do is this code:</p>
  
  <pre><code>Style style = new Style();
  style = (Style) Resources["st"];
  Setter setter =(Setter) style.Setters[1];
  setter.Value = 30;
  </code></pre>
  
  <p>after setting font size to <code>30</code> I get this error?</p>
  
  <p><strong>After a “SetterCollectionBase” is in use (sealed), it cannot be modified</strong></p>
  
  <p>How can I solve this problem?</p>