When I create a new window using the "Add Element ..." dialog, the created Window, for example. NewWindow
, not inherited from Window. It has only the same interface as the Object
type. Example:
I have a popup window code below. The code sees only members of IHavePassword
, and not the rest of the LoginPopup members, like its controls.
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
OH, XAML is also required here:
<Window x:Class="ApptEase.Client.Prism.Views.LoginPopup" .... <StackPanel Orientation="Vertical" Margin="0"> <DockPanel LastChildFill="True"> <TextBlock Text="{Binding Path=UsernameLabel}" DockPanel.Dock="Left" TextAlignment="Right" Margin="5,9,5,5" MinWidth="70" /> <TextBox Text="{Binding Path=Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" Width="Auto" Margin="5" /> </DockPanel> <DockPanel LastChildFill="True"> <TextBlock Text="{Binding Path=PasswordLabel}" DockPanel.Dock="Left" TextAlignment="Right" Margin="5" MinWidth="70" /> <PasswordBox x:Name="PasswordBox" PasswordChanged="PassWordChangedHandler" Width="Auto" Margin="5" /> </DockPanel> <DockPanel LastChildFill="True" Height="59"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <Button Content="Log in" Command="{Binding Path=LoginCommand}" CommandParameter="{Binding ElementName=This}" Margin="5" Padding="15,10,15,10" /> <Button Content="Cancel" Command="{Binding Path=CancelCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Margin="5" Padding="15,10,15,10"/> </StackPanel> </DockPanel> </StackPanel>
IntelliSense for the Me
property lists IHavePassword
members, for example:

I would expect to see the controls and base members of Window
, not those that have an interface. How can i fix this?