コード例 #1
0
			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));
			}
コード例 #2
0
            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));
            }
コード例 #3
0
			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));
			}
コード例 #4
0
            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));
            }
コード例 #5
0
			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));
			}
コード例 #6
0
            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));
            }