Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 1.09 KB

Preparing-the-XAML-code.md

File metadata and controls

12 lines (11 loc) · 1.09 KB

You have to initialize the localization engine in order to get values at design-time and to set up default dictionaries and assemblies (refer to Multiple assemblies and dictionaries).

First of all, create a xmlns reference to "http://wpflocalizeextension.codeplex.com". The next step is to set the design time culture as well as default assembly and dictionary where the resource is located:

<Window xmlns:lex="http://wpflocalizeextension.codeplex.com"
        lex:LocalizeDictionary.DesignCulture="en"
        lex:ResxLocalizationProvider.DefaultAssembly="AssemblyTestResourceLib"
        lex:ResxLocalizationProvider.DefaultDictionary="Strings">
<!-- Some controls -->
</Window>

The value of DesignCulture can be changed dynamically during design time and will have an immediate effect on all localized properties. This gives you the possibility to check the correct localization directly in the WPF designer. This example configures the resx provider. For a full explanation on this provider, refer to Localization providers.