ConverterMigrationHelperMixins class¶
Defined in
Namespace: ReactiveUI
Assembly: ReactiveUI.Core.dll
Full name: ReactiveUI.ConverterMigrationHelperMixins
Modifiers: public static
Summary¶
Provides helper methods for migrating converters from Splat to the new ConverterService.
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 class assists with migrating from the legacy Splat-based converter registration to the new ConverterService-based system introduced in ReactiveUI v20.
When to Use:
-
You have existing code that registers converters directly with Splat's IMutableDependencyResolver.
-
You want to preserve existing Splat-registered converters while migrating to the new system.
-
You need to extract converter instances for inspection or manual registration.
Migration Strategies:
- 1.
Automatic (Recommended): Use the ReactiveUIBuilder.WithConvertersFrom() method
to automatically import all Splat-registered converters during application initialization.
- 2.
Manual Extraction: Use ExtractConverters to get all converters from Splat, then inspect or register them manually.
- 3.
Direct Import: Use ImportFrom to import converters directly into an existing ConverterService instance.
Examples¶
Example 1: Automatic migration via builder (recommended)
// Import all existing Splat-registered converters automatically
RxAppBuilder.CreateReactiveUIBuilder()
.WithConvertersFrom(AppLocator.Current)
.WithConverter(new AdditionalConverter()) // Add new converters
.BuildApp();
Example 2: Manual extraction and inspection
// Extract converters for inspection
var (typed, fallback, setMethod) = ConverterMigrationHelperMixins.ExtractConverters(AppLocator.Current);
Console.WriteLine($"Found {typed.Count} typed converters");
Console.WriteLine($"Found {fallback.Count} fallback converters");
Console.WriteLine($"Found {setMethod.Count} set-method converters");
// Register them individually if needed
var converterService = new ConverterService();
foreach (var converter in typed)
{
converterService.TypedConverters.Register(converter);
}
Example 3: Direct import into existing service
var converterService = RxConverters.Current;
converterService.ImportFrom(AppLocator.Current);
Methods¶
| Name | Summary |
|---|---|
| static ExtractConverters | Extracts all converters from a Splat dependency resolver. |
| static ImportFrom |
Inherited members
Extension blocks¶
extension(ConverterService converterService)¶
ImportFrom