title: Why aren't new WPF Windows I create inheriting from Window?
body: <p>When I create a new Window, using the Add Item... dialogue, the Window I create, e.g. <code>NewWindow</code>, does not inherit from Window. It only has the same interface as type <code>Object</code>. An example:</p>
  
  <p>I have the popup window code below. The code only sees the <code>IHavePassword</code> members, and not the rest of the members of `LoginPopup', like its controls.</p>
  
  <pre><code>Public Class LoginPopup
      Implements IHavePassword
  
      Public ReadOnly Property Password As SecureString Implements IHavePassword.Password
          Get
              'Return Me.PasswordBox.????
          End Get
      End Property
  
      Public Event PasswordChanged As RoutedEventHandler Implements IHavePassword.PasswordChanged
      Public Sub PassWordChangedHandler(sender As Object, e As EventArgs)
          PasswordChangedEvent(sender, e)
      End Sub
  
      Public Sub Close() Implements IHavePassword.Close
          Throw New NotImplementedException
      End Sub
  
  End Class
  </code></pre>
  
  <p>OH, here is the necessary XAML as well:</p>
  
  <pre><code>&lt;Window x:Class="ApptEase.Client.Prism.Views.LoginPopup"
  ....
  &lt;StackPanel Orientation="Vertical" Margin="0"&gt;
      &lt;DockPanel LastChildFill="True"&gt;
          &lt;TextBlock Text="{Binding Path=UsernameLabel}" DockPanel.Dock="Left" TextAlignment="Right" Margin="5,9,5,5" MinWidth="70" /&gt;
          &lt;TextBox Text="{Binding Path=Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" Width="Auto" Margin="5" /&gt;
      &lt;/DockPanel&gt;
      &lt;DockPanel LastChildFill="True"&gt;
          &lt;TextBlock Text="{Binding Path=PasswordLabel}" DockPanel.Dock="Left" TextAlignment="Right" Margin="5" MinWidth="70" /&gt;
          &lt;PasswordBox x:Name="PasswordBox" PasswordChanged="PassWordChangedHandler" Width="Auto" Margin="5" /&gt;
      &lt;/DockPanel&gt;
      &lt;DockPanel LastChildFill="True" Height="59"&gt;
          &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right"&gt;
              &lt;Button Content="Log in" Command="{Binding Path=LoginCommand}" CommandParameter="{Binding ElementName=This}" Margin="5" Padding="15,10,15,10" /&gt;
              &lt;Button Content="Cancel" Command="{Binding Path=CancelCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Margin="5" Padding="15,10,15,10"/&gt;
          &lt;/StackPanel&gt;
      &lt;/DockPanel&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>The IntelliSense on the property <code>Me</code> lists the members of <code>IHavePassword</code>, e.g:</p>
  
  <p><a href="https://i.stack.imgur.com/bCsuZ.png" rel="nofollow"><img src="https://i.stack.imgur.com/bCsuZ.png" alt="enter image description here"></a></p>
  
  <p>I would expect to see the controls and base <code>Window</code> members here, not those of the interface. How do I go about fixing this?</p>