// Show Monsters private async void ShowModalPageBattleParty() { // 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; _myModalBattlePartyPage = new BattlePartyPage(); await Navigation.PushModalAsync(_myModalBattlePartyPage); }
// 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; } }