title: How to pass StaticResources to a ViewModel in MVVM?
body: <p>My application (MVVM Light) resizes it's main window (hides and shows it with an animation). For the animation I use a DataTrigger with parameters from StaticResources:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;system:Double x:Key="WindowMaxWidth"&gt;400&lt;/system:Double&gt;
      &lt;system:Double x:Key="WindowMinWidth"&gt;25&lt;/system:Double&gt;
  &lt;/Window.Resources&gt;
  &lt;Window.Style&gt;
      &lt;Style TargetType="Window"&gt;
          &lt;Style.Triggers&gt;
              &lt;DataTrigger Binding="{Binding DropBox.IsShown}" Value="True"&gt;
                  &lt;DataTrigger.EnterActions&gt;
                      &lt;BeginStoryboard&gt;
                          &lt;Storyboard&gt;
                              &lt;DoubleAnimation Storyboard.TargetProperty="Width"
                                               To="{StaticResource WindowMaxWidth}"
                                               Duration="0:0:0:0.2"/&gt;
                          &lt;/Storyboard&gt;
                      &lt;/BeginStoryboard&gt;
                  &lt;/DataTrigger.EnterActions&gt;
                  &lt;DataTrigger.ExitActions&gt;
                      &lt;BeginStoryboard&gt;
                          &lt;Storyboard&gt;
                              &lt;DoubleAnimation Storyboard.TargetProperty="Width"
                                               To="{StaticResource WindowMinWidth}"
                                               Duration="0:0:0:0.2"/&gt;
                          &lt;/Storyboard&gt;
                      &lt;/BeginStoryboard&gt;
                  &lt;/DataTrigger.ExitActions&gt;
              &lt;/DataTrigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/Window.Style&gt;
  </code></pre>
  
  <p>In my ViewModel I need my window's width value, so I bound it. The problem is that it's 0 by default, so I have to initialize it with a value. Actually what need is the value form my static resources: <strong>WindowMaxWidth</strong>.</p>
  
  <ol>
  <li>I can't move the value of WindowMaxWidth to ViewModel because DataTriggr doesn't accept bindings (it complains about threads)</li>
  <li>I don't want to keep the same value separately in StaticResources and ViewModel to avoid incoherence.</li>
  </ol>
  
  <p>What should I do?</p>