title: How to add further style setters programmatically? When I try I got an InvalidOperationException exception (SetterBaseCollection is in use)
body: <p>I have several style definitions in my App.xaml file. Like this:</p>
  
  <pre><code>&lt;Application x:Class="MyClient.App" ... &gt;
      &lt;Application.Resources&gt;
          &lt;SolidColorBrush x:Key="color1" Color="#FF7D7D" /&gt;
          &lt;SolidColorBrush x:Key="color2" Color="#FF7D7E" /&gt;
  
          &lt;Style x:Key="styleFor1" TargetType="charting:ColumnDataPoint"&gt;
              &lt;Setter Property="Background" Value="{StaticResource color1}" /&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="charting:ColumnDataPoint"&gt;
                          &lt;Grid&gt;
                              &lt;Rectangle&gt;
                                  &lt;Rectangle.Fill&gt;
                                      &lt;LinearGradientBrush&gt;
                                          &lt;GradientStop Color="#ffff3737" Offset="0" /&gt;
                                          &lt;GradientStop Color="#80000000" Offset="1" /&gt;
                                      &lt;/LinearGradientBrush&gt;
                                  &lt;/Rectangle.Fill&gt;
                              &lt;/Rectangle&gt;
                              &lt;ToolTipService.ToolTip&gt;
                                  &lt;StackPanel&gt;
                                      &lt;ContentControl Content="VALUES:" FontWeight="Bold" /&gt;
                                      &lt;ContentControl Content="{TemplateBinding FormattedIndependentValue}" /&gt;
                                      &lt;ContentControl Content="{TemplateBinding FormattedDependentValue}" /&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/ToolTipService.ToolTip&gt;
                          &lt;/Grid&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>I generate a chart. And give its DataPointStyle this:</p>
  
  <pre><code>Style dpStyle = Application.Current.Resources["styleFor1"]
  </code></pre>
  
  <p>after that, I would like to add some more Setters to this dpStyle. And when it is done I set the chart's DataPointStyle to this dpStyle. And then I got the exception. What should I do? Please guide me.</p>
  
  <p>UPDATE:</p>
  
  <p>Exception details (might needed):</p>
  
  <p><strong>InvalidOperationException was unhandled</strong></p>
  
  <p><strong>{"After a 'SetterBaseCollection' is in use (sealed), it cannot be modified."}</strong></p>
  
  <p><strong>TargetSite: {Void CheckSealed()}</strong></p>