//---------------------------------------------------------------------- // NOTE: This method takes the removed popup as an argument to help ensure consistency public void PopPopup(Panel _popup) { if (mPopupStack.Count == 0 || mPopupStack.Peek() != _popup) { throw new InvalidOperationException("Cannot pop a popup if it isn't at the top of the stack"); } mPopupStack.Pop(); PopupScreen.Root.Clear(); if (mPopupStack.Count > 0) { PopupScreen.Root.AddChild(mPopupFade); var panel = (Panel)mPopupStack.Peek(); PopupScreen.Root.AddChild(panel); PopupScreen.Focus(panel); } }