private void CbSourceLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e) { documentTranslation.SelectedSourceLanguage = e.AddedItems[0].ToString(); if (InputBox != null) { if ((TranslationServices.Core.TranslationServiceFacade.LanguageNameToLanguageCode(documentTranslation.SelectedSourceLanguage) == "he") || (TranslationServices.Core.TranslationServiceFacade.LanguageNameToLanguageCode(documentTranslation.SelectedSourceLanguage) == "ar")) { InputBox.HorizontalAlignment = HorizontalAlignment.Right; InputBox.TextAlignment = TextAlignment.Right; InputBox.FlowDirection = FlowDirection.RightToLeft; InputBox.HorizontalContentAlignment = HorizontalAlignment.Right; } else { InputBox.HorizontalAlignment = HorizontalAlignment.Left; InputBox.TextAlignment = TextAlignment.Left; InputBox.FlowDirection = FlowDirection.LeftToRight; InputBox.HorizontalContentAlignment = HorizontalAlignment.Left; } ResultBox.InvalidateArrange(); InputBox.UpdateLayout(); } }