var goToWindow = new Window1(); goToWindow.Show(); Window windowToClose = (Window)(this.Parent); windowToClose.Close();