WPF C# Tutorial

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Menu" Height="375.2" Width="252">
    
      
        
        
        
        
        
        
        
        
        
        
        
        
        
        
      
        
    


//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Reflection;
namespace LayoutPanels
{
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            Button cmd = (Button)e.OriginalSource;
                
            Type type = this.GetType();
            Assembly assembly = type.Assembly;                       
            Window win = (Window)assembly.CreateInstance("YourNameSpace." + cmd.Content);
            win.ShowDialog();
        }
    }
}