Silverlight MVVM : How to do Localization in the correct way? -


in normal silverlight projects, localization in xaml view done using:

text="{bindingpath=applicationstrings.mynewstring, source={staticresource resourcewrapper}}" 

my question : how correct localization labels when using mvvm pattern?

is done described here ?

in xaml view:

text="{binding lblusername,fallbackvalue='user name'}" 

and loginviewmodel.cs class:

public string lblusername {     { return resources.username; } } 

any tips here ?


and how reusing same string on multiple view/viewmodels ? (just imagine need 'username' on multiple views.) make sense to derive viewmodels basemodel defines resources ?

check out article on localization using mvvm.

http://cloudringer.wordpress.com/2011/02/18/localization-in-wpf-and-silverlight-with-mvvm/

there many ways solve problem depending on needs , constraints. approach describe has been flexible , blendable enough meet needs in wpf , silverlight on multiple projects.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -