private void HistoryOnWorkspaceChanged(object sender, WorkspacePair workspacePair) { var wrapper = Items.First(item => item.Module == workspacePair.Module); wrapper.ChangeWorkspace(workspacePair.Workspace); ActiveItem = wrapper; }
private void Push(WorkspacePair pair) { // If the current page is somewhere in the middle of history we remove all old ones // This creates browser like behaviour while (CurrentIndex < _history.Count - 1) { _history.RemoveAt(CurrentIndex + 1); } _history.Add(pair); Move(_history.Count - 1); }
/// <summary> /// Module tries to push itself onto the stack as result of a server side notification /// </summary> /// <returns>True if screen was pushed - false if enqueued!</returns> public bool TryPush(IWorkspaceModule module, IModuleWorkspace workspace) { var pushedPair = new WorkspacePair(module, workspace); if (Current.Workspace.CurrentInteraction != WorkspaceInteraction.Idle) { _pushedScreens.Add(pushedPair); return(false); } // Current screen idles - so just push Push(pushedPair); return(true); }