![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Framework(Content)Element.Language and DataBinding Hello, I have experimented with databinding and localization. I use WinFX beta 2 on WinXP sp2 cz. 1. When you set .Language in XAML to say cs-CZ (I am from Czech republic ;-) it works fine for databound elements when the .Language is set to them directly or to their (indirect) parent (say Window). But it does not work when directly set to databound element in DataTemplate - the .Language is always en-US. Eg.: <TextBlock Text="{Binding Source={x:Static s ateTime.Now}}"Language="cs-CZ" /> .... bug: Language="en-US" <DataTemplate> <TextBlock Text="{Binding Source={x:Static s ateTime.Now}}"Language="cs-CZ" /> .... OK: Language="cs-CZ" </DataTemplate> 2. When I run my WinFX application, CultureInfo.Curent(UI)Culture is cs-CZ, but Window.Language is en-US. Would not it be better to synchronize the default valu of LanguageProperty dependency property with Curent(UI)Culture? But the problem is which one to use. Framework(Content)Element.Language should use CurentUICulture but IValueConverter should use CurentCulture. But there is only Language property and no UILanguage one. What do you suggest? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Framework(Content)Element.Language and DataBinding re: #2, Window.Language is going to be whatever you set it to (or en-us if you didn't set it). That property describes what language the form was written in (which may or may not be the same as what the user wants) -- language affects how text is rendered, the same Unicode characters can be rendered differently depending on language. -- -Nick Kramer [MSFT] http://blogs.msdn.com/nickkramer This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Marek" <Marek@discussions.microsoft.com> wrote in message news:4DF7AD18-D8B7-4593-9B11-CB84EEC1D7B1@microsoft.com... > Hello, > I have experimented with databinding and localization. > I use WinFX beta 2 on WinXP sp2 cz. > 1. > When you set .Language in XAML to say cs-CZ (I am from Czech republic ;-) > it > works fine for databound elements when the .Language is set to them > directly > or to their (indirect) parent (say Window). But it does not work when > directly set to databound element in DataTemplate - the .Language is > always > en-US. > > Eg.: > <TextBlock Text="{Binding Source={x:Static s ateTime.Now}}"> Language="cs-CZ" /> > ... bug: Language="en-US" > <DataTemplate> > <TextBlock Text="{Binding Source={x:Static s ateTime.Now}}"> Language="cs-CZ" /> > ... OK: Language="cs-CZ" > </DataTemplate> > > 2. > When I run my WinFX application, CultureInfo.Curent(UI)Culture is cs-CZ, > but > Window.Language is en-US. > Would not it be better to synchronize the default valu of LanguageProperty > dependency property with Curent(UI)Culture? But the problem is which one > to > use. > Framework(Content)Element.Language should use CurentUICulture but > IValueConverter should use CurentCulture. > But there is only Language property and no UILanguage one. > What do you suggest? > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| can't update .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5(KB951847 | Windows Updates | |||
| ANN: Bricksoft IM(MSN) SDK For .NET Framework/.NET Compact Framework v1.2 released | Live Messenger | |||
| Set-Content not updating file after get-content and forEach-Object | PowerShell | |||
| Issue: getting/setting variable content using Get/Set-Content | PowerShell | |||
| Weirdness with get-content | replace | set-content - file content is deleted!! | PowerShell | |||