title: MyUserControl cannot be the root of a XAML file because it was defined using XAML
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/269106/inheriting-from-a-usercontrol-in-wpf">Inheriting from a UserControl in WPF</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to create a WPF user control, which is derived from an other user control, which I also have defined.</p>
  
  <pre><code>&lt;myNamespace:NavigationControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:myNamespace="clr-namespace:myNamespace" mc:Ignorable="d"
  x:Class="myNamespace.WelcomeScreen"
  x:Name="UserControl"
  d:DesignWidth="640" d:DesignHeight="480"&gt;
  </code></pre>
  
  <p>and here's what WelcomeScreen.cs looks like:</p>
  
  <pre><code>public partial class WelcomeScreen : NavigationControl
  {
      public WelcomeScreen()
      {
          this.InitializeComponent();
      }
  }
  </code></pre>
  
  <p>When I compile this, I get following error:</p>
  
  <blockquote>
    <p>'myNamespace.NavigationControl' cannot be the root of a XAML file because it was defined using XAML.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>