Skip to content

VisibilityToBooleanTypeConverter.GetAffinityForObjects() method

Defined in

Type: VisibilityToBooleanTypeConverter Namespace: ReactiveUI Assembly: ReactiveUI.WinUI.dll

Applies to

net10.0-windows10.0.19041, net10.0-windows10.0.19041, net9.0-windows10.0.19041, net9.0-windows10.0.19041, net8.0-windows10.0.19041, net462, net481

public override int GetAffinityForObjects()

View source

Inherited documentation

These docs were inherited from BindingTypeConverter<Visibility, bool>. The member doesn't override them on this type.

Summary: Returns the affinity score for this converter.

Returns: int -- A positive integer indicating converter priority. Higher values win when multiple converters match. Return 0 if the converter cannot handle the type pair.

Remarks

Affinity Guidelines:

  • 0 - Cannot convert (no conversion possible)
  • 1 - Last resort converters (e.g., EqualityTypeConverter)
  • 2 - Standard ReactiveUI core converters (string, numeric, datetime)
  • 8 - Platform-specific standard converters (NSDate, WinForms controls)
  • 100+ - Third-party override range (use to override ReactiveUI defaults)

When multiple converters match the same type pair, the converter with the highest affinity is selected. Third-party converters should return 100 or higher to override ReactiveUI defaults.