private void ChangeSecondSelection(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (e.AddedItems != null && e.AddedItems.Count == 1 && e.AddedItems[0] != null)
            {
                try
                {
                    _secondActiveReco = new SpeechRecognizerUI();
                    _selectedSecondLanguage = (LangDisplay)e.AddedItems[0];
                    //Change the first language buttons
                    //secondSpeakBtn.Content = _selectedSecondLanguage.SpeakString;
                    //secondLangSelectBtn.Content = _selectedSecondLanguage.LangSelf;
                    //Change the second language listener
                    // the language listener we want may not be installed
                    // so lets check to see if it is or isn't installed.
                    bool languageInstalled = false;
                    foreach (SpeechRecognizerInformation sri in InstalledSpeechRecognizers.All)
                    {
                        if (sri.Language == _selectedSecondLanguage.LangCode)
                        {
                            _secondActiveReco.Recognizer.SetRecognizer(sri);
                            languageInstalled = true;
                        }
                    }
                    if (!languageInstalled)
                        MessageBox.Show("You have not installed the speech recognition for that language. Please visit the speech section of your settings to install it.");
                    //Change the first language speaker
                    foreach (VoiceInformation vi in InstalledVoices.All)
                    {
                        if (vi.Language == _selectedSecondLanguage.LangCode)
                        {
                            _secondSpeechSynth = new SpeechSynthesizer();
                            _secondSpeechSynth.SetVoice(vi);
                        }
                    }
                    BitmapImage bit = new BitmapImage(new Uri(_selectedSecondLanguage.LangFlag, UriKind.Relative));
                    Image newSecondImage = new Image();

                    newSecondImage.Source = bit;
                    secondFlag.Child = newSecondImage;
                    secondLangText.Text = _selectedSecondLanguage.LangSelf;
                    secondLangHeader.Text = _selectedSecondLanguage.LangSelf;
                }
                catch { }
            }
            HideSecondLangList.Begin();
        }
        private void ChangeFirstSelection(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if(e.AddedItems != null && e.AddedItems.Count == 1 && e.AddedItems[0] != null)
            {     try  {
                if (_firstActiveReco == null)
                    _firstActiveReco = new SpeechRecognizerUI();

                _selectedFirstLanguage = (LangDisplay)e.AddedItems[0];
                //Change the first language buttons
                //firstSpeakBtn.Content = _selectedFirstLanguage.SpeakString;
                //firstLangSelectBtn.Content = _selectedFirstLanguage.LangSelf;
                //Change the first language listener
                foreach(SpeechRecognizerInformation sri in InstalledSpeechRecognizers.All)
                {
                    if(sri.Language == _selectedFirstLanguage.LangCode)
                    {
                        _firstActiveReco.Recognizer.SetRecognizer(sri);
                        //firstConfirmBox.Language = sri.Language;
                    }
                }

                //Change the first language speaker
foreach (VoiceInformation vi in InstalledVoices.All)
{
    if (vi.Language == _selectedFirstLanguage.LangCode)
    {
        _firstSpeechSynth = new SpeechSynthesizer();
        _firstSpeechSynth.SetVoice(vi);
    }
}
                firstFlag.Source = new BitmapImage( new Uri(_selectedFirstLanguage.LangFlag, UriKind.Relative));
                firstLangText.Text = _selectedFirstLanguage.LangSelf;
                firstLangHeader.Text = _selectedFirstLanguage.LangSelf;
            } catch{
            }
                
            }

            // Close the selection UI
            HideFirstLangList.Begin();
        }