Class ExpressionHelpers
Helper for manipulating the view expressions.
public static class ExpressionHelpers
- Inheritance
-
ExpressionHelpers
- Inherited Members
Methods
ConvertControlExpressionToBaseClassExpression<TView, TProp, TResult>(Expression<Func<TView, TProp>>)
Converts an expression for a property on a control to be an expression to a base class.
public static Expression<Func<TView, TResult>> ConvertControlExpressionToBaseClassExpression<TView, TProp, TResult>(Expression<Func<TView, TProp>> viewPropExpression) where TProp : class, TResult where TResult : class
Parameters
viewPropExpression
Expression<Func<TView, TProp>>Expression representing the derived control.
Returns
- Expression<Func<TView, TResult>>
Expression for targeting the member on the base class.
Type Parameters
TView
The type for view the control is on.
TProp
The type for the property.
TResult
The base type for the property.
GetControlPropertyExpressionFromViewExpression<TView, TProp, TResult>(Expression<Func<TView, TProp>>, string)
Takes a view property expression and rewrites it to target the control property.
public static Expression<Func<TView, TResult>> GetControlPropertyExpressionFromViewExpression<TView, TProp, TResult>(Expression<Func<TView, TProp>> viewPropExpression, string propertyName)
Parameters
viewPropExpression
Expression<Func<TView, TProp>>Expression representing the view property.
propertyName
stringThe name of the property to target.
Returns
- Expression<Func<TView, TResult>>
Expression for binding to a control property.
Type Parameters
TView
The type for the view.
TProp
The type for the property, which will be a control in the different UI frameworks.
TResult
The type for the bound result.