private void ChooseCamera(int idx) { new Thread(() => { continueListing = false; doneListing.WaitOne(); Console.WriteLine("Select camera " + idx); Dispatcher.Invoke(() => { MainWindow window = new MainWindow(idx); window.Show(); Close(); }); }).Start(); }
private void OpenFile_Click(object sender, RoutedEventArgs e) { var d = new OpenFileDialog(); if (d.ShowDialog(this) == true) { MainWindow window = new MainWindow(d.FileName); window.Show(); Close(); } }