title: Creating a window that inheritate from an interface/abstract class and Window
body: <p>I'm creating a WPF application and I encountered a problem with the inheritance.<br>
  I have a class called <code>DataHandler</code> that make a link between GUI class and data class.<br>
  The code need to stay open, because the GUI or the Data part could change in the future, so the <code>DataHandler</code> use interface or abstract class reference to the real GUI/Data class.  </p>
  
  <p>For exemple, I have a <code>SelectionFrame</code> and it needs to use <code>SetSelection()</code> and <code>GetSelection()</code>, I created a <code>ISelectionGUI</code> interface that have both of the method.  and the <code>SelectionFrame</code>implements it.  </p>
  
  <pre><code>public interface ISelectionGUI
  {
      void SetSelection(HashSet&lt;String&gt; fields);
  
      void GetSelection(HashSet&lt;String&gt; fields);
  }
  
   public partial class SelectionFrame : Window, ISelectionGUI
  {
     [...]
  }
  </code></pre>
  
  <p>In the <code>DataHandler</code> class it goes like this:</p>
  
  <pre><code>ISelectionGUI sF = new SelectionFrame();
  </code></pre>
  
  <p>But while doing this, I'm unable to use the <code>Window</code> method, except if I cast it like this:</p>
  
  <pre><code>((Window)sF).Show();
  </code></pre>
  
  <p>Wich don't seem to be the best solution since there is nothing that will force the next developer to extend <code>Window</code>.<br>
  I also tried to use an abstract class that extended <code>Window</code> and had the method that I needed. <code>SelectionFrame</code>extended that class and I changed the xaml <a href="http://mrpmorris.blogspot.fr/2012/08/partial-declarations-of-must-not.html" rel="nofollow">(following this)</a>:  </p>
  
  <pre><code>&lt;base:ISelectionGUI x:Class="WFChecker.SelectionFrame"
      [...]
      xmlns:base="clr-namespace:WFChecker"
      [...]
  &lt;/base:ISelectionGUI&gt;
  </code></pre>
  
  <p>But I didn't work since VisualStudio don't let me use an abstract class in the designer.
  My question is: How do I manage to create a frame that implement a class or extends an abstract class, while still being able to access the <code>Window</code> methods ?</p>