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