Intersoft.Client.Framework Namespace : LocalizationConverter Class |
Public Class LocalizationConverter Implements IMultiValueConverter
Dim instance As LocalizationConverter
public class LocalizationConverter : IMultiValueConverter
public ref class LocalizationConverter : public IMultiValueConverter
LocalizationConverter implements IMultiValueConverter, which means it is designated for data binding with a MultiBinding declaration.
LocalizationConverter makes it easy to merge one or more dynamic values based on a templated string. For instance, consider a TextBlock that displays the status of a file upload control such as "Uploading 3 of 10 files". With MultiBinding and LocalizationConverter, you can easily display a localized resource using data binding, and have the resource updated automatically whenever one of the specified data binding property changes.
LocalizationConverter dispatches the given values in the following manner:
The following example shows how to define the LocalizationConverter and MultiBinding in XAML to achieve the example referred in the above description.
XAML |
Copy Code
|
---|---|
<Intersoft:UXPage.Resources> <core:LocalizationConverter x:Key="LocalizationConverter"/> </Intersoft:UXPage.Resources> <TextBlock HorizontalAlignment="Center"> <core:BindingFramework.MultiBinding> <core:MultiBinding TargetProperty="Text" Converter="{StaticResource LocalizationConverter}"> <core:BindingCollection> <Binding Path="ProgressStatus" Source="{StaticResource UploadResource}"/> <core:RelativeBinding Path="TotalUploadingFiles" RelativeSourceMode="TemplatedParent" ParentType="UXFileUpload"/> <core:RelativeBinding Path="TotalFilesToUpload" RelativeSourceMode="TemplatedParent" ParentType="UXFileUpload"/> </core:BindingCollection> </core:MultiBinding> </core:BindingFramework.MultiBinding> </TextBlock> |
For more information about ClientUI Localization Manager, see Localization Overview.
System.Object
Intersoft.Client.Framework.LocalizationConverter
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2