public MainWindow() { InitializeComponent(); if (ApiKeysIncorrect()) { MessageBox.Show( "You seem to be missing an API-key. Check your API-key settings in App.config...", "API-keys", MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(); } SetupWebcamImageDirectory(); SpeechRecognitionViewModel = new SpeechRecognitionViewModel(); _webCamera = new WebCam(); _webCamera.InitializeWebCam(ref WebCameraImage); DataContext = this; }
private void MainWindow_OnClosing(object sender, CancelEventArgs e) { SpeechRecognitionViewModel.Dispose(); }