title: DynamicResource binding to Color not working
body: <p>I have a style being created in the xaml for my window which contains bindings to a DynamicResource:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;local:RowColorConverter x:Key="RowColorConverter" /&gt;
          &lt;Style x:Key="OddEvenRowStyle"&gt;
              &lt;Setter Property="DataGridRow.Background"&gt;
                  &lt;Setter.Value&gt;
                      &lt;Binding RelativeSource="{RelativeSource AncestorType=GroupItem}" Path="(ItemsControl.AlternationIndex)" Converter="{StaticResource RowColorConverter}"&gt;
                          &lt;Binding.ConverterParameter&gt;
                              &lt;x:Array Type="Brush"&gt;
                                  &lt;SolidColorBrush Color="{DynamicResource RowPrimaryBrush}" /&gt;
                                  &lt;SolidColorBrush Color="{DynamicResource RowSecondaryBrush}" /&gt;
                              &lt;/x:Array&gt;
                          &lt;/Binding.ConverterParameter&gt;
                      &lt;/Binding&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>I then assign the style to a RowStyle for a DataGrid:</p>
  
  <pre><code>&lt;DataGrid Name="dataGrid" AutoGenerateColumns="False" Height="Auto" Width="Auto" ItemsSource="{Binding}" RowStyle="{StaticResource OddEvenRowStyle}"&gt;
  </code></pre>
  
  <p>In the initialization of my window I'm assigning these DynamicResource values:</p>
  
  <pre><code>Resources["RowPrimaryBrush"] = Colors.LightGray;
  Resources["RowSecondaryBrush"] = Colors.DarkGray;
  </code></pre>
  
  <p>However when I load up the window the colors aren't working correctly:</p>
  
  <p><img src="https://i.stack.imgur.com/ipsyt.png" alt="enter image description here"></p>
  
  <p>I'm pretty sure the rest of my code is okay because when I change the Color values in xaml to color values:</p>
  
  <pre><code>&lt;x:Array Type="Brush"&gt;
      &lt;SolidColorBrush Color="LightGray" /&gt;
      &lt;SolidColorBrush Color="DarkGray" /&gt;
  &lt;/x:Array&gt;
  </code></pre>
  
  <p>The colors get assigned correctly:</p>
  
  <p><img src="https://i.stack.imgur.com/mQCoj.png" alt="enter image description here"></p>
  
  <p>Which is why I'm led to believe it's something to do with the bindings. Is there something wrong with the way I'm binding my colors?</p>