Recommended

  • Silverlight.FX
    Silverlight.FX is a light-weight application framework for building RichInternet Applications with Silverlight 2.
  • Building Modular Silverlight Applications
  • Prism -  10 Things to Know
  • Securing Silverlight Application and WCF Service using ASP.Net Authentication Techniques
  • Model– View – ViewModel in Silverlight
Skip Navigation LinksHome / News / View News

How to Get Localized Resources from RESX File in Code Behind

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Oct 22, 2009
(0 votes)
In this quick Silverlight tip Alex Golesh shows how to use localized resources from the RESX files.

Here I already explained how to create the RESX files for Silverlight (by the way the article is relevant also for Visual Studio 2010 Beta 2 & Silverlight 3), and how to use those resources from XAML. In some cases, though, it is needed to use those resources from code behind. In my scenario I had to create value converter, which converts some Boolean value to string representation and for localizes application I had to provide localized value.

In order to use resources from code behind one need to get instance of ResourceManager class, and the use its methods to get the resource by name for any supported culture.

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 3 and 3 and type the answer here: