title: Why are colors/brushes not shown when using ResourceDictionary?
body: <p>I have some application wide resources in my programm:</p>
  
  <pre><code>&lt;Application.Resources&gt;
      &lt;ResourceDictionary&gt;
  
          &lt;!--Colors--&gt;
          &lt;Color x:Key="PaleRed" R="255" G="127" B="127" /&gt;
          &lt;Color x:Key="PaleGreen" R="222" G="255" B="209" /&gt;
          &lt;Color x:Key="PaleBlue" R="112" G="200" B="255" /&gt;
          &lt;Color x:Key="LightGray" R="155" G="155" B="155" /&gt;
          &lt;Color x:Key="DarkGray" R="100" G="100" B="100" /&gt;
  
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>In my ViewModel I get the Background</p>
  
  <pre><code>public Brush Background
      {
          get
          {
              Color paleRed = (Color)Application.Current.Resources["PaleRed"];
              Color paleGreen = (Color)Application.Current.Resources["PaleGreen"];
              Color paleBlue = (Color)Application.Current.Resources["PaleBlue"];
              Color lightGray = (Color)Application.Current.Resources["LightGray"]; 
  
              #region comment
              paleRed = Color.FromRgb(255, 127, 127);
              paleGreen = Color.FromRgb(222, 255, 209);
              paleBlue = Color.FromRgb(112, 200, 255);
              lightGray= Color.FromRgb(112, 112, 112);
              #endregion
  
              if (ComponentType == ComponentType.test)
              {
                  return new SolidColorBrush(paleBlue);
              }
  
              var color = Percentage &gt; 0.0 ? paleGreen : paleRed;
              Brush solidBack = new SolidColorBrush(color);
              Brush gradientBack = new LinearGradientBrush(lightGray, color, 0);
  
              return Amount-AmountSold &gt; 0 ? solidBack : gradientBack;
          }
      }
  </code></pre>
  
  <p>When setting the Background like it is in the example above (region not commented), it shows the colors in the right way. If I comment the reassignment, the colors are not shown (only white background). But when I set a breakpoint with the region commented, the colors(and brushes) are not null and have the right ARGB values.</p>
  
  <p>Can anyone tell me why this happens?</p>