title: How to close only child on click of a button in WPF
body: <p>I have created MDI form using <a href="http://wpfmdi.codeplex.com/" rel="nofollow noreferrer">CodePlex DLL</a>, I have added a WPF user control and opened it as a child with below code:</p>
  <pre><code>MainMdiContainer.Children.Add(new MdiChild()
          {
              Title = &quot; Employee Master&quot;,
              Height = 300,
              Width = 500,
              //Here CustomerMaster is the class that you have created for mainWindow.xaml user control.
              Content = new EmpMaster()
          });
  </code></pre>
  <p>Now I want to close only that child form (WPF User Control) on Click of a button.I have used following code on that button click:</p>
  <pre><code>Window.GetWindow(this).Close();
  </code></pre>
  <p>But that code close the program along with all opened window and MDI parent also. How can I close only that particular WPF user control on button click?</p>