![Customize Resource Strings 01.png](images/Customize_Resource_Strings_01.png)
This topic explains how to customize the resource strings of an Ultimate UI for WPF control.
The topic is organized as follows:
You can customize the string values that an Ultimate UI for WPF control displays to the end user. These strings include items such as dialog box captions, warning messages, filter options and alerts. This makes localizing your application a very easy and straight forward process.
In the following picture, the xamGrid control has the resource strings of the GroupBy and Filtering features customized:
Figure 1: The xamGrid control with GroupBy and filtering resource strings customized
Customization of UI strings is supported for the following controls:
xamCalendar
xamColorPicker
xamDockManager
xamGrid
xamMap
xamOutlookBar
xamPivotGrid
xamRibbon
xamSchedule (on ScheduleControlBase class)
xamScheduleDialogs (on ScheduleDialogFactory)
xamSpellChecker (on xamSpellChecker class)
Customization of error messages is supported for the following controls:
xamBarcode
xamComboEditor
xamDataTree
xamNetworkNode
xamTimeline
xamTreemap
xamMenu
xamMaskedInput
The resource files of a control follow the same naming convention as the assemblies. For example, xamBarcode control’s resource file is named InfragisticsWPF.Controls.Barcodes.xamBarcode.resx.
The control’s resource files are available publicly in our WPF Resources GitHub repository.
Each control has a RegisterResources() method which is used to register the resource file. This method accepts two parameters:
The first parameter is the name of the embedded resource file that contains the resources to be used. Generally it follows the format of:
Default namespace + path + filename
The second parameter is the assembly in which the resource file is embedded.
To register your customized resource files:
Add a new Resources File (.resx) file to your project, ensuring that it is embedded.
Add customized strings with keys of those strings corresponding to the controls actual key. For example, using the xamBarcode control’s actual keys, you can change the strings associated with the loading of data, as demonstrated in the following screenshot.
In Visual Basic:
XamBarcode.RegisterResources("BarcodeResourceStringsSample",GetType(MainWindow).Assembly)
In C#:
XamBarcode.RegisterResources("BarcodeResourceStringsSample", typeof(MainWindow).Assembly);
You do not need to supply a string value for every available string in the control: you can choose which strings you want to customize. If you register more than one resource file and they contain the same strings, the resource file that is registered last will have priority with that resource file string value displayed to the end user.
You can also reset the default resource strings of a control by unregistering a customized resource string. This can be done by calling the control’s UnregisterResources() method.
This method takes one parameter:
The name of the embedded resource file that was previously registered
In Visual Basic:
XamBarcode.UnregisterResources("BarcodeResourceStringsSample")
In C#:
XamBarcode.UnregisterResources("BarcodeResourceStringsSample");