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
| Name | Type | Description |
|---|---|---|
fromType | Type | The runtime source type (guaranteed non-null). |
from | object | The value to convert (guaranteed non-null). |
toType | Type | The target type (guaranteed non-null). |
conversionHint | object? | Implementation-defined conversion hint (e.g., format string, culture). |
out result | object? | 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.