public void AddToHistory(NodeHistoryElement nodeHistoryElem) { //put the last focal node into the history before setting the new one if (_history.Count == 0) { _history.Push(nodeHistoryElem); } else if (_history.Peek().Node.Id != nodeHistoryElem.Node.Id) { _history.Push(nodeHistoryElem); } }
private void SetHistory(string name, INodeProxy node) { if (node != null) { if (name == null) { name = "Home"; } NodeHistoryElement item = new NodeHistoryElement() { Name = name, Node = node }; _navHistory.AddToHistory(item); } }
public Guid GoBack() { Guid previousNodeId = Guid.Empty; if (HasHistory) { NodeHistoryElement nhe = _history.Pop(); if (HasHistory) { previousNodeId = _history.Peek().Node.Id; } else { previousNodeId = nhe.Node.Id; } } return(previousNodeId); }