public void ConstantConstraint (bool useCompiledXaml) { var layout = new ConstraintExpression (useCompiledXaml); var label = layout.constantConstraint; var constraint = RelativeLayout.GetWidthConstraint (label); Assert.NotNull (constraint); Assert.AreEqual (42, constraint.Compute (null)); }
public void ConstantConstraint(bool useCompiledXaml) { var layout = new ConstraintExpression(useCompiledXaml); var label = layout.constantConstraint; var constraint = RelativeLayout.GetWidthConstraint(label); Assert.NotNull(constraint); Assert.AreEqual(42, constraint.Compute(null)); }
public void ConstraintRelativeToParent (bool useCompiledXaml) { var layout = new ConstraintExpression (useCompiledXaml); layout.relativeLayout.Layout (new Rectangle (0, 0, 200, 200)); var label = layout.constraintRelativeToParent; var constraint = RelativeLayout.GetWidthConstraint (label); Assert.NotNull (constraint); Assert.AreEqual (102, constraint.Compute (layout.relativeLayout)); }
public void ConstraintRelativeToParent(bool useCompiledXaml) { var layout = new ConstraintExpression(useCompiledXaml); layout.relativeLayout.Layout(new Rectangle(0, 0, 200, 200)); var label = layout.constraintRelativeToParent; var constraint = RelativeLayout.GetWidthConstraint(label); Assert.NotNull(constraint); Assert.AreEqual(102, constraint.Compute(layout.relativeLayout)); }
public void ContraintRelativeToView (bool useCompiledXaml) { var layout = new ConstraintExpression (useCompiledXaml) { IsPlatformEnabled = true }; layout.relativeLayout.Layout (new Rectangle (0, 0, 200, 100)); layout.foo.Layout (new Rectangle (5, 5, 190, 25)); var label = layout.constraintRelativeToView; var constraint = RelativeLayout.GetWidthConstraint (label); Assert.NotNull (constraint); Assert.AreEqual (97, constraint.Compute (layout.relativeLayout)); }
public void ContraintRelativeToView(bool useCompiledXaml) { var layout = new ConstraintExpression(useCompiledXaml) { IsPlatformEnabled = true }; layout.relativeLayout.Layout(new Rectangle(0, 0, 200, 100)); layout.foo.Layout(new Rectangle(5, 5, 190, 25)); var label = layout.constraintRelativeToView; var constraint = RelativeLayout.GetWidthConstraint(label); Assert.NotNull(constraint); Assert.AreEqual(97, constraint.Compute(layout.relativeLayout)); }