In normal Silverlight projects, localization in the xaml view is done using:
Text="{BindingPath=ApplicationStrings.MyNewString, Source={StaticResource ResourceWrapper}}"
My question is : how to do correct localization from labels when using the MVVM pattern?
Is this done like described here ?
In xaml view:
Text="{Binding LblUsername,FallbackValue='User Name'}"
And the LoginViewModel.cs class:
public string LblUsername
{
get { return Resources.Username; }
}
Any tips here ?
And how about reusing the same string on multiple view/viewmodels ? (Just imagine that I need 'Username' on multiple views.) Does it make sense to to derive all viewmodels from a basemodel which defines all resources ?