开发者

Dynamic localization with Data Annotations possible?

I'm trying to dynamicly update the language of a Silverlight application. I tried the examp开发者_StackOverflow中文版le 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"/> 
<TextBox x:Name="tbUserName" Text="{Binding UserName, Mode=TwoWay}" />

Thanks, Ron

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜