title: Get the resource in the MainWindow in WPF
body: <p>I have added a <code>Cursor</code> file as a resource in my <code>MainWindow.xaml</code>, how can I access this resource from within a <code>Border</code> element that resides inside this window in code?</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;FrameworkElement x:Key="OpenHand" Cursor="pack://application:,,,/Resources/openhand.cur"/&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/Window.Resources&gt;
  
  &lt;Grid x:Name="AppInterface"&gt;
       // A Border is added here by code
       // I want to be able to access the above resource from Border in code-behind
  &lt;/Grid&gt;
  </code></pre>