public override void AwakeFromNib() { base.AwakeFromNib(); OutlineView.Initialize(); ((OutlineViewDelegate)OutlineView.Delegate).EVOutlineViewClicked = EVOutlineViewClicked; { var TableViews = new TreeDataItem("Vegetables"); TableViews.AddItem(new TreeDataItem("Cabbage")); TableViews.AddItem(new TreeDataItem("Turnip")); TableViews.AddItem(new TreeDataItem("Radish")); TableViews.AddItem(new TreeDataItem("Carrot")); OutlineView.AddItem(TableViews); } { var TableViews = new TreeDataItem("Fruits"); TableViews.AddItem(new TreeDataItem("Grape")); TableViews.AddItem(new TreeDataItem("Cucumber")); OutlineView.AddItem(TableViews); } OutlineView.ReloadData(); OutlineView.ExpandItem(null, true); }
public void AddItem(TreeDataItem item) { if (Data != null) { Data.Items.Add(item); } }
// item of OutlineView public void EVOutlineViewClicked(NSOutlineView outlineView, TreeDataItem item) { var u = item; SelectItemName.StringValue = u.Name; }
public void RemoveItem(TreeDataItem item) { _Items.Remove(item); }
public void Insert(int n, TreeDataItem _item) { _Items.Insert(n, _item); }
public void AddItem(TreeDataItem _data) { _Items.Add(_data); }