public MindmapDataItem GetMindmapDataItem(string label, MindmapDataItem parent) { MindmapDataItem item = new MindmapDataItem() { Label = label, Parent = parent }; return(item); }
private void OnAddLeftChild(object obj) { if (this.SelectedItems is SelectorViewModel sv) { if (sv.Nodes is ObservableCollection <object> nodes && nodes.Any()) { var parent = (nodes.First() as NodeViewModel).Content as MindmapDataItem; var item = new MindmapDataItem() { Label = "New Child", Parent = parent, Direction = RootChildDirection.Left }; (this.DataSourceSettings.DataSource as MindmapDataItems).Add(item); this.LayoutManager.Layout.InvalidateLayout(); } } }