BindingTypeConverterRegistry class¶
Attributes: [DebuggerDisplay("BindingTypeConverterRegistry")]
Defined in
Namespace: ReactiveUI
Assembly: ReactiveUI.Core.dll
Full name: ReactiveUI.BindingTypeConverterRegistry
Modifiers: public sealed
Summary¶
Thread-safe registry for typed binding converters using a lock-free snapshot pattern.
Applies to
net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471
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¶
| Name | Summary |
|---|---|
| .ctor |
Methods¶
| Name | Summary |
|---|---|
| Register | Registers a typed binding converter. |
| TryGetConverter | Attempts to retrieve the best converter for the specified type pair. |
| GetAllConverters | Returns all registered converters. |