// Show CharacterSelect private async void ShowModalPageCharacterSelect() { // When you want to show the modal page, just call this method // add the event handler for to listen for the modal popping event: Crawl.App.Current.ModalPopping += HandleModalPopping; _myModalCharacterSelectPage = new OpeningPage(); await Navigation.PushModalAsync(_myModalCharacterSelectPage); }
// Helper to handle Modal navigation. private void HandleModalPopping(object sender, ModalPoppingEventArgs e) { if (e.Modal == _myModalBattleMonsterListPage) { _myModalBattleMonsterListPage = null; App.Current.ModalPopping -= HandleModalPopping; } if (e.Modal == _myModalCharacterSelectPage) { _myModalCharacterSelectPage = null; App.Current.ModalPopping -= HandleModalPopping; } if (e.Modal == _myModalBattlePartyPage) { _myModalBattlePartyPage = null; App.Current.ModalPopping -= HandleModalPopping; } }