public void GoToPage(TestPageType pageType) { if (_currentPageType == pageType) { return; //we're already on the same page, so don't bother doing anything } TestTitlePage pageToCreate = null; if (pageType == TestPageType.TitlePage) { pageToCreate = new TestTitlePage(); } if (pageToCreate != null) //destroy the old page and create a new one { _currentPageType = pageType; if (_currentPage != null) { _stage.RemoveChild(_currentPage); } _currentPage = pageToCreate; _stage.AddChild(_currentPage); _currentPage.Start(); } }
public override void HandleAddedToContainer(FContainer container) { base.HandleAddedToContainer(container); if (container is TestTitlePage) { this.gamePage = (TestTitlePage)container; } else { this.gamePage = null; } }