private void btn_openQuickBuild_Click(object sender, RoutedEventArgs e) { Trace.WriteLine("Open current project in QuickBuild ..."); saveCognexFile(); if (myJobManagerEdit == null) { if (myJobManager != null) { try { myJobManagerEdit = new CogJobManagerEdit(); myJobManagerEdit.ShowLocalizationTab = false; myJobManagerEdit.Subject = myJobManager; } catch { } } } FormsHoster formHoster = new FormsHoster(); formHoster.FormHost.Child = myJobManagerEdit; formHoster.WindowState = System.Windows.WindowState.Maximized; formHoster.ShowDialog(); formHoster = null; myJobManagerEdit = null; }