ObservationAffinityChecker.FindHigherAffinityPlugin(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 ICreatesObservableForProperty? FindHigherAffinityPlugin(Type type, string propertyName, int generatedAffinity, bool beforeChanged)
Summary: Finds the registered ICreatesObservableForProperty that 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: ICreatesObservableForProperty? -- The highest-scoring registration that beats the generated one, or null when none does.
Remarks
Generated code asks for the registration itself rather than for a yes-or-no, so the winner is scored
once and then observed through. Answering only "is there one" costs a second scan to find it again,
on a path every binding runs.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | type or propertyName is null. |