Click or drag to resize
LocalizerSetCulture Method
Changes the culture of the current thread.

Namespace: DW.SharpTools
Assembly: DW.SharpTools (in DW.SharpTools.dll) Version: 2.4.0.0 (2.4.0.0)
Syntax
C#
public static CultureChangedArgs SetCulture(
	CultureInfo newCulture,
	bool setXamlCulture = true
)

Parameters

newCulture
Type: System.GlobalizationCultureInfo
The new culture to set.
setXamlCulture (Optional)
Type: SystemBoolean
Indicates of the culture of the FrameworkElement should be set to. This can be done just once at the application lifetime.

Return Value

Type: CultureChangedArgs
The object containing all data about the culture change.
Exceptions
ExceptionCondition
ArgumentNullExceptionnewCulture is null
Remarks
If setXamlCulture is set to true and it was set already before, an LanguageSwitchException is set in the result data. The language in XAML bindings are not changed then. The XAML culture can be set just once in the application lifetime. The XAML culture is used in StringFormat like 'G' or similar. Consider using an IValueConverter instead.
See Also