Skip to content

IBindingFallbackConverter.TryConvert(Type, object, Type, object?, object?) method

Defined in

Type: IBindingFallbackConverter Namespace: ReactiveUI.Binding.Reactive Assembly: ReactiveUI.Binding.Reactive.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-ios18.0, net9.0-macos15.0, net9.0-desktop1.0, net8.0, net8.0-macos14.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, netstandard2.1, net481, net462, net471

bool TryConvert(Type fromType, object from, Type toType, object? conversionHint, out object? result)

Summary: Attempts to convert the value to the target type.

Parameters

NameTypeDescription
fromTypeTypeThe runtime source type (guaranteed non-null).
fromobjectThe value to convert (guaranteed non-null).
toTypeTypeThe target type (guaranteed non-null).
conversionHintobject?Implementation-defined conversion hint (e.g., format string, culture).
out resultobject?The converted value. Implementations must produce a non-null value when returning true.

Returns: bool -- true if conversion succeeded; otherwise, false.

Remarks

Returning true obliges an implementation to produce a non-null result, but that obligation is not expressed as a nullability annotation: implementations come from outside the library and nothing enforces it. The dispatch layer therefore checks, and reports a null result as a failed conversion rather than letting it reach a binding.

Null input handling is performed by the dispatch layer. This method will never receive null as the from parameter.