Open edgarfgp opened 2 years ago
public static Constraint RelativeToView(View view, Func<RelativeLayout, View, double> measure) { var result = new Constraint { _measureFunc = layout => measure(layout, view), RelativeTo = new[] { view } }; return result; }
public static BoundsConstraint FromExpression(Expression<Func<Rectangle>> expression, IEnumerable<View> parents = null) { return FromExpression(expression, false, parents); }
internal static BoundsConstraint FromExpression(Expression<Func> expression, bool fromExpression, IEnumerable parents = null) { Func compiled = expression.Compile(); var result = new BoundsConstraint { _measureFunc = compiled, RelativeTo = parents ?? ExpressionSearch.Default.FindObjects(expression).ToArray(), // make sure we have our own copy CreatedFromExpression = fromExpression };
return result;
}
RelativeToView is missing from v1 and V2 . Would be good to see if there is anyway we can support this as we move forward to stable 2.0
internal static BoundsConstraint FromExpression(Expression<Func> expression, bool fromExpression, IEnumerable parents = null)
{
Func compiled = expression.Compile();
var result = new BoundsConstraint
{
_measureFunc = compiled,
RelativeTo = parents ?? ExpressionSearch.Default.FindObjects(expression).ToArray(), // make sure we have our own copy
CreatedFromExpression = fromExpression
};
}