title: Custom cursor for entire WPF application
body: <p>I am trying to get a custom cursor for my WPF application. I already have the .cur file in the Resources. In the xaml, I mentioned the resource dictionary something like this:</p>
  <pre><code>&lt;Window.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;FrameworkElement x:Key=&quot;KinectCursor&quot; Cursor=&quot;Resources/KinectCursor.cur&quot;/&gt;
              &lt;FrameworkElement x:Key=&quot;KinectCursor16&quot; Cursor=&quot;Resources/KinectCursor16.cur&quot;/&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Window.Resources&gt;
  </code></pre>
  <p>In the code-behind, I tried to the set the Mouse.OverrdeCursor property to this cursor but it is throwing exceptions.</p>
  <pre><code> private void Window_Loaded(object sender, RoutedEventArgs e)
          {
              //Mouse.OverrideCursor = this.Resources[&quot;KinectCursor&quot;].Cursor;
              Mouse.OverrideCursor = ((FrameworkElement)this.Resources[&quot;KinectCursor&quot;]).Cursor;
              //DisplayArea.Cursor = Cursors.Hand;
          }
  </code></pre>
  <p>Exception Message:</p>
  <pre><code>XAMLParseException occured.
  'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' 
  threw an exception.' Line number '7' and line position '14'.
  </code></pre>