Skip to content

BindingTypeConverterRegistry class

Defined in

Namespace: ReactiveUI.Binding Assembly: ReactiveUI.Binding.dll Full name: ReactiveUI.Binding.BindingTypeConverterRegistry Modifiers: public sealed

Summary

View source

        Thread-safe registry for typed binding converters using a lock-free snapshot pattern.
        

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 registry uses a copy-on-write snapshot pattern optimized for read-heavy workloads:

-

Reads: Lock-free via a volatile read of the snapshot reference. Multiple readers can access the registry concurrently without contention.

-

Writes: Serialized under a lock. Writes clone the affected dictionary entry, mutate the clone, and publish a new snapshot atomically.

-

Selection: Converters are grouped by (FromType, ToType) pair. When multiple converters match, the one with the highest affinity (> 0) is selected.

This design prioritizes performance for the common case: converters are registered once at application startup, then looked up many times during binding operations.

Constructors

NameSummary
.ctor

Methods

NameSummary
RegisterRegisters a typed binding converter.
TryGetConverterAttempts to retrieve the best converter for the specified type pair.
GetAllConvertersReturns all registered converters.
Inherited members