Reflection class¶
Attributes: [Preserve(AllMembers = true)]
Defined in
Namespace: ReactiveUI.Reactive
Assembly: ReactiveUI.Reactive.dll
Full name: ReactiveUI.Reactive.Reflection
Modifiers: public static
Summary¶
Helper class for handling reflection and expression-tree related operations.
Applies to
net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471
Remarks¶
This type is part of ReactiveUI's infrastructure and is used by binding, observation, and other reflection-heavy code paths.
Trimming/AOT note: Some APIs in this type are inherently trimming-unfriendly (e.g. string-based type resolution and expression-driven member traversal). Such APIs are annotated accordingly.
Methods¶
| Name | Summary |
|---|---|
| static Rewrite | Uses the expression re-writer to simplify the expression down to its simplest expression. |
| static ExpressionToPropertyNames | Converts an expression that points to a property chain into a dotted path string. Sub-properties are separated by '.'. Index-based values include [] after the name, with the index argument... |
| static GetValueFetcherForProperty | Converts a MemberInfo into a delegate which fetches the value for the member. Supports fields and properties. |
| static GetValueFetcherOrThrow | Converts a MemberInfo into a delegate which fetches the value for the member. Supports fields and properties and throws if the... |
| static GetValueSetterForProperty | Converts a MemberInfo into a delegate which sets the value for the member. Supports fields and properties. |
| static GetValueSetterOrThrow | Converts a MemberInfo into a delegate which sets the value for the member. Supports fields and properties and throws if the... |
| static TryGetValueForPropertyChain | Based on a list of expressions, attempts to get the value of the last property in the chain. |
| static TryGetAllValuesForPropertyChain | Based on a list of expressions, attempts to produce an array of [IObservedChange](# values representing each step in the property chain. |
| static TrySetValueToPropertyChain | Based on a list of expressions, attempts to set the value of the last property in the chain, throwing on missing members. |
| static ReallyFindType | Gets a Type from the specified type name, using a cache to avoid repeated reflection. |
| static GetEventArgsTypeForEvent | Gets the appropriate EventArgs-derived type for the specified event name on a Type. |
| static ThrowIfMethodsNotOverloaded | Checks to make sure that the specified method names on the target type are overridden. |
| static ViewModelWhenAnyValue | Creates an observable that switches to observing the provided expression on the current ViewModel. |