Skip to content

BindingConverters class

Defined in

Namespace: ReactiveUI.Binding Assembly: ReactiveUI.Binding.dll Full name: ReactiveUI.Binding.BindingConverters Modifiers: public static

Summary

View source

        Provides static access to the ReactiveUI.Binding converter service.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Remarks

This class provides a global access point to the ConverterService instance used by ReactiveUI.Binding for binding type conversions.

Custom Converter Registration:

BindingConverters.Current.TypedConverters.Register(new MyCustomConverter());

Examples

Example: Manually resolving a converter

var converter = BindingConverters.Current.ResolveConverter(typeof(int), typeof(string));
 if (converter is IBindingTypeConverter typedConverter)
 {
 if (typedConverter.TryConvertTyped(42, null, out var result))
 {
 Console.WriteLine(result); // "42"
 }
 }

Properties

NameSummary
static CurrentGets the current converter service instance.
Inherited members