public MainWindow() { //Type t = Type.GetType("WpfTest.diags.Login"); //object login = Activator.CreateInstance(t); //Window dlg = login as Window; //dlg.ShowDialog(); Type t = Type.GetType("WpfTest.Window1"); var w = Activator.CreateInstance(t); var dlg = w as Window1; dlg.ShowDialog(); TestClone tc1 = new TestClone(); var tcc = tc1.Clone() as TestClone; tcc.Nodes.Clear(); InitializeComponent(); }