Beispiel #1
0
        private async Task <BrowseTreeItemViewModel[]> GetTreeChildren(BrowseTreeItemViewModel parent, Func <string[], Task <string[]> > getChildrenContent)
        {
            List <string>           path = new List <string>();
            BrowseTreeItemViewModel t    = parent;

            while (t != null)
            {
                path.Add(t.Text);
                t = t.Parent;
            }
            path.Reverse();
            var children = await getChildrenContent(path.ToArray());

            return(children.Select(child => new BrowseTreeItemViewModel(child, parent, new GetChildren(p => GetTreeChildren(p, getChildrenContent)))).ToArray());
        }
Beispiel #2
0
 public BrowseTreeItemViewModel(string text, BrowseTreeItemViewModel parent, GetChildren children = null) : this(text, children)
 {
     this.parent = parent;
 }