Hi,
We found that CellValuePresenter' text is different ValueEditor's text if the value contains parentheses in Arabic. Is this a right behavior?
xaml codes:
<igDP:FieldSettings.EditorStyle><Style TargetType="{x:Type igEditors:XamTextEditor}"></Style></igDP:FieldSettings.EditorStyle>
Current CultureInfo: ar-KW.
CellValuePresneter' Text : XXX (1)
ValueEditor' Text :(XXX (1
Hello Brandon
Thank you for your feedback.
I am glad that you resolved your issue and I believe that other community members may benefit from this as well. Please let me know if you require any further assistance on the matter.
Thank you. Actually, we found better solution on stackoverflow too.Sorry to didn't notify you timely.
Better soltions:
FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(TextElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(DefinitionBase), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(FixedDocument), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(FixedDocumentSequence), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(FlowDocument), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(TableColumn), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
Hello Brandon,
It seems that the issue is caused from the Language property( https://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.language%28v=vs.110%29.aspx ) in WPF and its defaults mode(‘en-US’). So even you set the culture to be ‘ar-KW’ it still uses ‘en-US’ and this is the reason why the TextBox and TextBlock on the form and the TextBox from our editor are adjusting the Parentheses(‘(’). The reason this looks different for the non-edit mode text is because that editor is using a SimpleTextBlock and when it is constructing the formatted text to render it is using our GetLanguageCultureInfo method which ignores the Language if it is the default ‘en-US’ and instead uses the CurentCulture – so the SimpleTextBlock ends up using ‘ar-KW’ in this case. In order to achieve the correct behavior you can set this Language property:
this.Language = XmlLanguage.GetLanguage("ar-KW");
From the following link you can read more details regarding similar issue:
http://stackoverflow.com/questions/15471500/right-to-left-bracket-display-wrong
Please do not hesitate to let me know if you require any further assistance regarding this matter.
Hi zhivko,
I know this issue from MS. But it seems xamDatagrid have a strange behavior that presenter'value is different with editor's value in Arabic.And MS TextBox always showing "Text : XXX (1)" in Arabic.
If the current culture is Hebrew as below codes, these two values are same.So i'm confuse that.
public MainWindow() { InitializeComponent();
xdg.DataContext = Data.GetData(10, 1, 10);
this.FlowDirection = FlowDirection.RightToLeft; Thread.CurrentThread.CurrentUICulture = new CultureInfo("he"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("he");
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("he"); CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("he"); }
Hello Bardon,
It seems that this issue is not related with our controls. If you apply same text and setting to the MS Textbox you will observe the same behavior. I believe in this case you can ask Microsoft experts in the MSDN forum.