public ConfirmGameView() { InitializeComponent(); object temp; //check which screen the previous one was if (phoneAppService.State.ContainsKey("sender")) { if (phoneAppService.State.TryGetValue("sender", out temp)) { //if it was the correct screen, read in the game if(temp.ToString().Equals("ConfirmPlayersView")) { if (phoneAppService.State.ContainsKey("myGame")) { if (phoneAppService.State.TryGetValue("myGame", out temp)) { myGame = (Game)temp; setDataContext(); } } } } } }
//read in the game details from the application service state R.P. public void loadGame() { object temp; if (phoneAppService.State.ContainsKey("myGame")) { if (phoneAppService.State.TryGetValue("myGame", out temp)) { myGame = (Game)temp; } } }
public void loadGame() { object temp; string myTeam = ""; //check which screen the previous one was if (phoneAppService.State.ContainsKey("sender")) { if (phoneAppService.State.TryGetValue("sender", out temp)) { myTeam = temp.ToString(); if (phoneAppService.State.ContainsKey("myGame")) { if (phoneAppService.State.TryGetValue("myGame", out temp)) { myGame = (Game)temp; if (myTeam.Equals("home")) { team = myGame.homeTeam; } else { team = myGame.awayTeam; } } } if (phoneAppService.State.ContainsKey("player")) { if (phoneAppService.State.TryGetValue("player", out temp)) { player = temp.ToString(); } } if (phoneAppService.State.ContainsKey("assist")) { if (phoneAppService.State.TryGetValue("assist", out temp)) { assist = temp.ToString(); } } } } }