public TypeSelectorControl() { this.checkbox = NSButton.CreateCheckbox(Properties.Resources.ShowAllAssemblies, OnCheckedChanged); this.checkbox.TranslatesAutoresizingMaskIntoConstraints = false; AddSubview(this.checkbox); var scroll = new NSScrollView { TranslatesAutoresizingMaskIntoConstraints = false }; var d = new TypeSelectorDelegate(); this.outlineView = new NSOutlineView { Delegate = d, AutoresizingMask = NSViewResizingMask.WidthSizable, HeaderView = null, Action = new ObjCRuntime.Selector("onActivatedItem"), Target = this }; var col = new NSTableColumn(); this.outlineView.AddColumn(col); this.outlineView.OutlineTableColumn = col; scroll.DocumentView = this.outlineView; AddSubview(scroll); this.filter = new NSTextField { TranslatesAutoresizingMaskIntoConstraints = false, PlaceholderString = "Filter" }; this.filter.Changed += OnFilterChanged; AddSubview(this.filter); AddConstraints(new[] { NSLayoutConstraint.Create(this.filter, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1, 10), NSLayoutConstraint.Create(this.filter, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1, -20), NSLayoutConstraint.Create(this.filter, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterX, 1, 0), NSLayoutConstraint.Create(scroll, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this.filter, NSLayoutAttribute.Bottom, 1, 8), NSLayoutConstraint.Create(scroll, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this.filter, NSLayoutAttribute.Width, 1, 0), NSLayoutConstraint.Create(scroll, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterX, 1, 0), NSLayoutConstraint.Create(scroll, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, this.checkbox, NSLayoutAttribute.Top, 1, -8), NSLayoutConstraint.Create(this.checkbox, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, this, NSLayoutAttribute.Bottom, 1, -10), NSLayoutConstraint.Create(this.checkbox, NSLayoutAttribute.Left, NSLayoutRelation.Equal, scroll, NSLayoutAttribute.Left, 1, 0) }); }