4 instantiations of Constraint
Microsoft.Maui.Controls (4)
LegacyLayouts\Constraint.cs (4)
23 var result = new Constraint { _measureFunc = parent => size }; 31 var result = new Constraint 42 var result = new Constraint { _measureFunc = measure }; 49 var result = new Constraint { _measureFunc = layout => measure(layout, view), RelativeTo = new[] { view } };
45 references to Constraint
Microsoft.Maui.Controls (44)
LegacyLayouts\Constraint.cs (8)
21 public static Constraint Constant(double size) 23 var result = new Constraint { _measureFunc = parent => size }; 28 public static Constraint FromExpression(Expression<Func<double>> expression) 31 var result = new Constraint 40 public static Constraint RelativeToParent(Func<RelativeLayout, double> measure) 42 var result = new Constraint { _measureFunc = measure }; 47 public static Constraint RelativeToView(View view, Func<RelativeLayout, View, double> measure) 49 var result = new Constraint { _measureFunc = layout => measure(layout, view), RelativeTo = new[] { view } };
LegacyLayouts\ConstraintExpression.cs (6)
12 public class ConstraintExpression : IMarkupExtension<Constraint> 31 return (this as IMarkupExtension<Constraint>).ProvideValue(serviceProvider); 34 public Constraint ProvideValue(IServiceProvider serviceProvider) 44 return Constraint.RelativeToParent(p => (double)minfo.Invoke(p, Array.Empty<object>()) * Factor + Constant); 46 return Constraint.Constant(Constant); 65 return Constraint.RelativeToView(view, delegate (RelativeLayout p, View v)
LegacyLayouts\ConstraintTypeConverter.cs (2)
23 return Constraint.Constant(size); 25 throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", strValue, typeof(Constraint)));
LegacyLayouts\RelativeLayout.cs (28)
19 public static readonly BindableProperty XConstraintProperty = BindableProperty.CreateAttached("XConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged); 22 public static readonly BindableProperty YConstraintProperty = BindableProperty.CreateAttached("YConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged); 25 public static readonly BindableProperty WidthConstraintProperty = BindableProperty.CreateAttached("WidthConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged); 28 public static readonly BindableProperty HeightConstraintProperty = BindableProperty.CreateAttached("HeightConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged); 126 public static Constraint GetHeightConstraint(BindableObject bindable) 128 return (Constraint)bindable.GetValue(HeightConstraintProperty); 131 public static Constraint GetWidthConstraint(BindableObject bindable) 133 return (Constraint)bindable.GetValue(WidthConstraintProperty); 136 public static Constraint GetXConstraint(BindableObject bindable) 138 return (Constraint)bindable.GetValue(XConstraintProperty); 141 public static Constraint GetYConstraint(BindableObject bindable) 143 return (Constraint)bindable.GetValue(YConstraintProperty); 151 public static void SetHeightConstraint(BindableObject bindable, Constraint value) 156 public static void SetWidthConstraint(BindableObject bindable, Constraint value) 161 public static void SetXConstraint(BindableObject bindable, Constraint value) 166 public static void SetYConstraint(BindableObject bindable, Constraint value) 275 void CreateBoundsFromConstraints(View view, Constraint xConstraint, Constraint yConstraint, Constraint widthConstraint, Constraint heightConstraint) 347 void Add(T view, Constraint xConstraint = null, Constraint yConstraint = null, Constraint widthConstraint = null, Constraint heightConstraint = null); 390 public void Add(View view, Constraint xConstraint = null, Constraint yConstraint = null, Constraint widthConstraint = null, Constraint heightConstraint = null)
Microsoft.Maui.Controls.Build.Tasks (1)
CompiledConverters\ConstraintTypeConverter.cs (1)
20 throw new BuildException(BuildExceptionCode.Conversion, node, null, value, typeof(Compatibility.Constraint));