ObservationAffinityChecker.HasHigherAffinityPlugin(Type, string, int, bool) method¶
Defined in
Type: ObservationAffinityChecker
Namespace: ReactiveUI.Binding.Reactive.Fallback
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
public static bool HasHigherAffinityPlugin(Type type, string propertyName, int generatedAffinity, bool beforeChanged)
Summary: Returns true if a registered ICreatesObservableForProperty outranks generatedAffinity.
Parameters
| Name | Type | Description |
|---|---|---|
type | Type | The type being observed. |
propertyName | string | The property being observed on that type. |
generatedAffinity | int | The affinity of the source generator's selected plugin. |
beforeChanged | bool | Whether before-change (PropertyChanging) observation is requested. |
Returns: bool -- true if a user plugin should override the generated observation.
Remarks
The property name is half the question. A plugin scores a type and a property together - the WPF, WinUI,
WinForms and KVO plugins all answer 0 for a property their mechanism does not reach, whatever the type -
so asking without one makes every mechanism-specific registration score 0 and lose by construction.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | type is null. |