Dynamic localization with Data Annotations possible?

Posted by devries48 on Stack Overflow See other posts from Stack Overflow or by devries48
Published on 2010-04-05T06:29:40Z Indexed on 2010/04/05 6:33 UTC
Read the original article Hit count: 993

Hi,

I'm trying to dynamicly update the language of a Silverlight application. I tried the example provided by Tim Heuer and that was exactly wat I needed. Silverlight and localizing string data

Now I'm experimenting with Data Annotations and would like to have the same behaviour.But with no luck... Can someone point me in the right direction.

DataAnnotation of a property:

[Display(Name = "UserNameLabel", ResourceType = typeof(Resources.Strings.StringResources))]

[Required] public string Username ...

My Xaml:

<dataInput:Label Target="{Binding ElementName=tbUserName}" PropertyPath="UserName"/> 

Thanks, Ron

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about dataannotations