public void NavigateBackstack(GhTreeItem ti) { for (var i = Breadcrumbs.Count() - 1; i >= 0; i--) { var item = Breadcrumbs[i]; if (item != ti) // TODO: Revisit this logic once we store page state { Breadcrumbs.Remove(item); continue; } break; } SelectPath(ti, insertInBackStack:false); }
private void SelectPath(GhTreeItem pathTreeItem, bool insertInBackStack=true) { PathItems = null; var pathTree = this.PathTree; string path = pathTreeItem.Path; if (null != pathTree && null != path) { if (pathTree.ContainsKey(path)) { var unsortedItems = pathTree[path]; PathItems = unsortedItems .OrderBy(ti => ti.ItemTypeWeightForSorting) .ThenBy(ti => ti.Name) .ToList(); if (insertInBackStack) Breadcrumbs.Add(pathTreeItem); } } }