title: How to use a defined brush resource in XAML, from C#
body: <p>So far I have this</p>
  
  <pre><code>&lt;UserControl.Resource&gt;
   &lt;LinearGradientBrush x:Key="KeyDownBrush" .....&gt;
  </code></pre>
  
  <p>Now I would like to access this defined resource when a key is pressed and replace the current objects fill with the KeyDownBrush, in C#.</p>
  
  <p>I've tried this.Resource.Contains("KeyDownPress") and have been able to get True returned so I presume I am almost there but I'm not sure how to access the object and Parse it correctly to a Brush instance.</p>
  
  <p>Any guidance would be appreciated.</p>