title: Use Application.Resources in Class
body: <p>I do not know how to use a defined Application Style Resource in code.
  I have defined:</p>
  
  <pre><code>&lt;Application.Resources&gt; &lt;Style x:Key="OrangeButton" TargetType="{x:Type Button}"&gt;
  </code></pre>
  
  <p>I am using this resource in the XAML section of my application like:</p>
  
  <pre><code>&lt;Button Name="Button_Start" style="{StaticResource OrangeButton}" Margin="0"&gt;
  </code></pre>
  
  <p>and it is working fine, and I can also change the Button Style by code </p>
  
  <pre><code>Button_Start.Style = CType(FindResource("RedButton"), Style)
  </code></pre>
  
  <p>but only in the VB file that was automatically created when I created my new project. If I add a new class file and try do the same it says:</p>
  
  <pre><code>Name 'FindResource' is not declared
  </code></pre>
  
  <p>My problem is therefore, how to make use of Application resources in all the different class files in my application.</p>
  
  <p>Peter</p>