public void ShowPage(Page pageToShow) { if (ActivePage != pageToShow) { if (ActivePage != null) { ActivePage.ClosePage(); LastActivePage = ActivePage; } pageToShow.ShowPage(); ActivePage = pageToShow; } }
public void ClosePage(Page pageToClose) { if (MainPage != null) { MainPage.ShowPage(); ActivePage = MainPage; } else { if (LastActivePage != null) { LastActivePage.ShowPage(); ActivePage = LastActivePage; } } pageToClose.ClosePage(); LastActivePage = pageToClose; }
// Page Methods public void SetMainPage(Page MainPage) { this.MainPage = MainPage; }