Situation
You want to localize a WPF control.
Problem
Books on WPF recommend to use Microsofts LocBaml.exe, which is actually just a sample that is, of course, not integrated anywhere.
Solution
Localize the WPF control using ResX files.
- create the ResX files
- set the scope of the ResX files to public
- add the Properties namespace to your XAML
xmlns:res="clr-namespace:YourNamespace.Properties"
- use static binding to define the value
<TextBlock Text="{x:Static res:YourResource.YourResourceProperty}"/>
Sources
Leave a Reply