O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Localizing content programmatically

Some strings could also be set programmatically from code-behind files. To prepare a localized application, it is also necessary to translate them and present in the current language. In this recipe, you will learn how to use the ResourceLoader class to programmatically get localized content.

Getting ready

To step through this recipe, you need the project created in the previous recipe.

How to do it...

To prepare an example that shows how to localize content programmatically, you need to perform the following steps:

  1. Handle the event of clicking on the Submit button by modifying the MainPage.xaml file as follows:
     <Page (...)> <ScrollViewer> <StackPanel Padding="20"> (...) <Button x:Uid="BtnEntrySubmit" HorizontalAlignment="Stretch" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required