title: How to set one resource color value (from ResourceKey) to another (SolidColorBrush)
body: <p>I want to set new color to Application.Current.Resources["MainColor"]. I can do it like this: Application.Current.Resources["MainBackgroundColor"] = new SolidColorBrush(color); But I want this color to be from Infragistics.Windows.Ribbon.RibbonBrushKeys</p>
  
  <p>So I want to set value to:</p>
  
  <pre><code>Application.Current.Resources["MainColor"]
  </code></pre>
  
  <p>which is definied as:</p>
  
  <pre><code>&lt;SolidColorBrush x:Key="MainColor" Color="#FFEAF2FB" /&gt;
  </code></pre>
  
  <p>form Infragistics Ribbon resources:</p>
  
  <pre><code>public static readonly ResourceKey RibbonGroupCollapsedNormalBorderDarkFillKey;
  </code></pre>
  
  <p>In XAML I would do it for example like that:</p>
  
  <pre><code>&lt;Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource {x:Static igRibbon:RibbonBrushKeys.RibbonGroupCollapsedNormalBorderDarkFillKey}}"/&gt;
  </code></pre>
  
  <p>But I need to do it in C# codebehind.</p>
  
  <p>I have tried something like:</p>
  
  <pre><code>Application.Current.Resources["MainColor"] = Infragistics.Windows.Ribbon.RibbonBrushKeys["RibbonGroupCollapsedNormalBorderDarkFillKey"];
  </code></pre>
  
  <p>But it didn't work. I excepted to get color value from RibbonGroupCollapsedNormalBorderDarkFillKey.</p>
  
  <p>I also tried this:</p>
  
  <pre><code>Application.Current.Resources["MainColor"] = Application.Current.Resources["Infragistics.Windows.Ribbon.RibbonBrushKeys.RibbonGroupCollapsedNormalBorderDarkFillKey"];
  </code></pre>
  
  <p>I thought it will change colors, it compiled, but when I click button with this action it changed nothing... </p>
  
  <p>Any help here much appreciated!</p>