public void Pop() { if (_contextStack.Count != 0) { IBaseView curView = _contextStack.Peek(); _contextStack.Pop(); _UIDict.TryRemove(curView.ViewType.panelId); curView.OnExit(); } if (_contextStack.Count != 0) { IBaseView curView = _contextStack.Peek(); curView.OnResume(); } }
public void Push(int panelId) { IBaseView nextView = Core.UI.CreatePanel(panelId); if (_contextStack.Count != 0) { IBaseView curView = _contextStack.Peek(); if (IsNew(nextView)) { curView.OnExit(); } else { curView.OnPause(); } } _contextStack.Push(nextView); _UIDict.AddOrReplace(nextView.ViewType.panelId, nextView); nextView.OnEnter(); }