Skip to content

Reflection class

Attributes: [Preserve(AllMembers = true)]

Defined in

Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll Full name: ReactiveUI.Reactive.Reflection Modifiers: public static

Summary

View source

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

NameSummary
static RewriteUses the expression re-writer to simplify the expression down to its simplest expression.
static ExpressionToPropertyNamesConverts 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 GetValueFetcherForPropertyConverts a MemberInfo into a delegate which fetches the value for the member. Supports fields and properties.
static GetValueFetcherOrThrowConverts a MemberInfo into a delegate which fetches the value for the member. Supports fields and properties and throws if the...
static GetValueSetterForPropertyConverts a MemberInfo into a delegate which sets the value for the member. Supports fields and properties.
static GetValueSetterOrThrowConverts a MemberInfo into a delegate which sets the value for the member. Supports fields and properties and throws if the...
static TryGetValueForPropertyChainBased on a list of expressions, attempts to get the value of the last property in the chain.
static TryGetAllValuesForPropertyChainBased on a list of expressions, attempts to produce an array of [IObservedChange](# values representing each step in the property chain.
static TrySetValueToPropertyChainBased on a list of expressions, attempts to set the value of the last property in the chain, throwing on missing members.
static ReallyFindTypeGets a Type from the specified type name, using a cache to avoid repeated reflection.
static GetEventArgsTypeForEventGets the appropriate EventArgs-derived type for the specified event name on a Type.
static ThrowIfMethodsNotOverloadedChecks to make sure that the specified method names on the target type are overridden.
static ViewModelWhenAnyValueCreates an observable that switches to observing the provided expression on the current ViewModel.
Inherited members