public static void Instance(MainWindow main) { main.DetachControls(); ManualPlayerWindow NewForm = new ManualPlayerWindow(); NewForm.mainForm = main; SessionCore.Instance.Windows.Show(NewForm); }
public void CommandBinding_ManualMode(object sender, ExecutedRoutedEventArgs e) { if (!menuManualMode.IsEnabled) { return; } Window parent = Window.GetWindow(this); if (parent.GetType() == typeof(MainWindow)) { // Start manual mode. ManualPlayerWindow.Instance((MainWindow)parent); menuManualMode.IsChecked = true; } else if (parent.GetType() == typeof(ManualPlayerWindow)) { // Close manual mode. ((ManualPlayerWindow)parent).CloseManual(); menuManualMode.IsChecked = false; } }