Skip to content

BindingFallbackConverterRegistry class

Defined in

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

Summary

View source

        Thread-safe registry for fallback 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 converter list, mutate the clone, and publish a new snapshot atomically.

-

Selection: Fallback converters are stored in a simple list (no type-pair grouping). When looking up a converter, each converter's runtime affinity is checked via GetAffinityForObjects. The converter with the highest affinity (> 0) is selected.

Fallback converters are used when no exact type-pair match is found in the typed converter registry. They provide runtime type checking and conversion using techniques like reflection or type descriptors.

Constructors

NameSummary
.ctor

Methods

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