void addEdgeConstraint(NSLayoutAttribute edge, NSView parentView, NSView subView) { var constraint = NSLayoutConstraint.Create(subView, edge, NSLayoutRelation.Equal, parentView, edge, 1, 0); parentView.AddConstraint(constraint); }