public static void UpdateConstraints(LayoutConstraintItem item, Action <ConstraintMaker> closure) { if (item.Constraints?.Length <= 0) { MakeConstraints(item, closure); return; } var maker = new ConstraintMaker(item); closure(maker); var constraints = new List <Constraint>(); foreach (var description in maker._descriptions) { if (description.Constraint != null) { constraints.Add(description.Constraint); } } foreach (var constraint in constraints) { constraint.ActivateIfNeeded(updateExisting: true); } }
public ConstraintMaker(LayoutConstraintItem item) { _item = item; _item.Prepare(); _descriptions = new List <ConstraintDescription>(); }
public ConstraintDescription(LayoutConstraintItem item, ConstraintAttributes attributes) { Item = item; Constant = 0.0f; Priority = 1000.0f; Multiplier = 1.0f; Attributes = attributes; }
public static void RemoveConstraints(LayoutConstraintItem item) { var constraints = item.Constraints; foreach (var constraint in constraints) { constraint.DeactivateIfNeeded(); } }
public static Constraint[] PrepareConstraints(LayoutConstraintItem item, Action <ConstraintMaker> closure) { var maker = new ConstraintMaker(item); closure(maker); var constraints = new List <Constraint>(); foreach (var description in maker._descriptions) { if (description.Constraint != null) { constraints.Add(description.Constraint); } } return(constraints.ToArray()); }
public static void MakeConstraints(LayoutConstraintItem item, Action <ConstraintMaker> closure) { var maker = new ConstraintMaker(item); closure(maker); var constraints = new List <Constraint>(); foreach (var description in maker._descriptions) { if (description.Constraint != null) { constraints.Add(description.Constraint); } } foreach (var constraint in constraints) { constraint.ActivateIfNeeded(updateExisting: false); } }
public LayoutConstraint(LayoutConstraintItem itemA, NSLayoutAttribute attributeA, NSLayoutRelation relation, UIView itemB, NSLayoutAttribute attributeB, nfloat multiplier, nfloat constant) { _value = NSLayoutConstraint.Create(itemA.Value, attributeA, relation, itemB, attributeB, multiplier, constant); }
public static void RemakeConstraints(LayoutConstraintItem item, Action <ConstraintMaker> closure) { RemoveConstraints(item); MakeConstraints(item, closure); }