The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

Reflection.

TryGetValueForPropertyChain<TValue>(TValue, object?, IEnumerable<Expression>) Method

Summary

Based on a list of Expressions get the value of the last property in the chain if possible. The Expressions are typically property chains. Eg Property1.Property2.Property3 The method will make sure that each Expression can get a value along the way and get each property until each expression is evaluated.
Namespace
ReactiveUI
Containing Type
Reflection

Syntax

public static bool TryGetValueForPropertyChain<TValue>(out TValue changeValue, object? current, IEnumerable<Expression> expressionChain)

Type Parameters

Name Description
TValue The type of the end value we are trying to get.

Parameters

Name Type Description
changeValue TValue A output value where to store the value if the value can be fetched.
current object? The object that starts the property chain.
expressionChain IEnumerable<Expression> A list of expressions which will point towards a property or field.

Return Value

Type Description
bool If the value was successfully retrieved or not.