private void mCancelButton_Click(object sender, RoutedEventArgs e) { // terminate the recognizer mRecognizer.TerminateControl(); // terminate the application Application.Current.Terminate(); }