title: Access variable in code-behind from Resources in UserControl
body: <p>I have the following problem:
  I want to access one of these three vars, defined in XAML Resource</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="../../Themes/MainStyle.xaml" /&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;System:Int32 x:Key="maxVal"&gt;500&lt;/System:Int32&gt;
          &lt;System:Int32 x:Key="minVal"&gt;250&lt;/System:Int32&gt;
          &lt;System:Int32 x:Key="actualWidth"&gt;250&lt;/System:Int32&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>I want to access the value of "actualWidth" from Codebehind file like this:</p>
  
  <pre><code>private void MinMaxGraphicsMessageSink(bool minmax)
  {
     actualWidth = minmax ? 900 : 300;
  }
  </code></pre>
  
  <p>But this doesn't work.
  Can someone help?</p>