title: How do I create a base page in WPF?
body: <p>I have decided that all my WPF pages need to register a routed event.  Rather than include</p>
  
  <pre><code>public static readonly RoutedEvent MyEvent= EventManager.RegisterRoutedEvent("MyEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BasePage));
  </code></pre>
  
  <p>on every page, I decided to create a base page (named BasePage).  I put the above line of code in my base page and then changed a few of my other pages to derive from BasePage.  I can't get past this error:</p>
  
  <blockquote>
    <p>Error 12  'CTS.iDocV7.BasePage' cannot
    be the root of a XAML file because it
    was defined using XAML. Line 1
    Position
    22.   C:\Work\iDoc7\CTS.iDocV7\UI\Quality\QualityControlQueuePage.xaml    1   22  CTS.iDocV7</p>
  </blockquote>
  
  <p>Does anyone know how to best create a base page when I can put events, properties, methods, etc that I want to be able to use from any wpf page?</p>