private void swapLanguages_Click(object sender, RoutedEventArgs e) { if (currentLanguage.SelectedItem != null && targetLanguage.SelectedItem != null) { var temp = currentLanguage.SelectedItem; currentLanguage.SelectedItem = targetLanguage.SelectedItem; targetLanguage.SelectedItem = temp; SetCurrentLanguage?.Invoke(this, currentLanguage.SelectedItem as Language); SetTargetLanguage?.Invoke(this, targetLanguage.SelectedItem as Language); currentLanguageTextBox.Text = targetLanguageTextBox.Text; } }
private void targetLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e) { SetTargetLanguage?.Invoke(this, targetLanguage.SelectedItem as Language); }