Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Framework(Content)Element.Language and DataBinding

 
 
Old 06-02-2006   #1 (permalink)
Marek


 
 

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 sateTime.Now}}"
Language="cs-CZ" />
.... bug: Language="en-US"
<DataTemplate>
<TextBlock Text="{Binding Source={x:Static sateTime.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 SpecsSystem Spec
Old 06-05-2006   #2 (permalink)
Nick Kramer [MSFT]


 
 

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 sateTime.Now}}"
> Language="cs-CZ" />
> ... bug: Language="en-US"
> <DataTemplate>
> <TextBlock Text="{Binding Source={x:Static sateTime.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 SpecsSystem Spec
 

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46