So I am trying to get a value out of an rgPopupPage which I have set as a property of list.
I am calling the popup page as such.
private async void btnAddExistingPlayer_Clicked(object sender, EventArgs e)
{
var team = grdteamManagment.SelectedItem as Team;
if (team != null)
{
var page = new PlayerSelection(team.Id,true);
await PopupNavigation.Instance.PushAsync(page); // lets show the rg popup page
//normally in c# land I would this
var returnIds = page.PlayersId;
}
}
But for some reason it wont work cause it pops the navigation back in before hand.
Here is my button code where I set my PlayersIds
private async void btnSelectPlayers_Clicked(object sender, EventArgs e)
{
PlayersId = new List<int>();
var item = lvPlayers.SelectedItem as PlayersSelectViewModel;
txtPlayerToInclude.Text = item.Id.ToString();
if (rbMultiplePlayers.IsChecked)
{
var multiPlayers = lvPlayers.SelectedItems;
string playersIds = string.Empty;
foreach (PlayersSelectViewModel players in multiPlayers)
{
PlayersId.Add(players.Id);
lblPlayerName.Text += players.FullName;
}
txtPlayerToInclude.Text = String.Join(",", PlayersId);
}
else
{
var player = lvPlayers.SelectedItem as PlayersSelectViewModel;
if (player != null)
{
PlayersId.Add(player.Id);
txtPlayerToInclude.Text = string.Join("", PlayersId);
lblPlayerName.Text += player.FullName;
}
}
await PopupNavigation.Instance.PopAsync();
}
I have looked at the messaging examples but don't really understand how that bolts together.