//File:Window.xaml.vb Imports System Imports System.Windows Imports System.Windows.Controls Imports System.Windows.Data Imports System.Windows.Documents Imports System.Windows.Media Imports System.Windows.Media.Imaging Imports System.Windows.Shapes Imports System.Reflection Namespace LayoutPanels Public Partial Class Window1 Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub ButtonClick(sender As Object, e As RoutedEventArgs) Dim cmd As Button = DirectCast(e.OriginalSource, Button) Dim type As Type = Me.[GetType]() Dim assembly As Assembly = type.Assembly Dim win As Window = DirectCast(assembly.CreateInstance("YourNameSpace." & Convert.ToString(cmd.Content)), Window) win.ShowDialog() End Sub End Class End Namespace