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
viewPropExpressionExpression<Func<TView, TProp>>Expression representing the derived control.
Returns
- Expression<Func<TView, TResult>>
Expression for targeting the member on the base class.
Type Parameters
TViewThe type for view the control is on.
TPropThe type for the property.
TResultThe 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
viewPropExpressionExpression<Func<TView, TProp>>Expression representing the view property.
propertyNamestringThe name of the property to target.
Returns
- Expression<Func<TView, TResult>>
Expression for binding to a control property.
Type Parameters
TViewThe type for the view.
TPropThe type for the property, which will be a control in the different UI frameworks.
TResultThe type for the bound result.