Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

PushModalAsync to get username from new page, then PopModalAsync and use that username

$
0
0

Hi,

I'm trying to do the following, but the async isn't on the page like I was hoping - it's only on the displaying of the page.

var createPlayerPage = new CreatePlayerPage(nPlayerNumber);
await Navigation.PushModalAsync(createPlayerPage).ConfigureAwait(true);
var poppedPage = await Navigation.PopModalAsync();
m_PlayerViewModel.SetPlayerName(nPlayerNumber, ((CreatePlayerPage)poppedPage).Name);

I've only seen this work online by subscribing to an event that the player page fires when it closes, but is there a better way?

Thanks!
Mike


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>