/** * This method is called when an item is tapped in the list view of games */ private async void listPartie_ItemSelected(object sender, SelectedItemChangedEventArgs e) { ScorePartie sp = (ScorePartie)listPartie.SelectedItem; if (state == 0)//if in games panel in profil page { await Navigation.PushModalAsync(new DetailsPartiePage((ScorePartie)listPartie.SelectedItem)); } else if (state == 1) //if in stats panel in profil page { if (this.partieStatPage == null) { this.partieStatPage = new PartieStatPage(sp, sp.GolfName); } else { this.partieStatPage.changePartie(sp, sp.GolfName); } await Navigation.PushModalAsync(this.partieStatPage); } else if (state == 2) //when loading an existing and not finished game { partie.ScoreOfThisPartie = sp; foreach (ScoreHole sh in sp.scoreHoles) { partie.nextHole();//skip holes that was already done } //partie.holeFinishedCount++;//needs to increment one last time because this attibute is initialized to -1 to start at 0 after first main game page appearing await Navigation.PushAsync(new Play.Game.MainGamePage(partie), false); } }
public ViewPartieListPage(int state, List <ScorePartie> scoreParties, Partie partie) { InitializeComponent(); this.state = state; this.partieStatPage = null; this.scoreParties = scoreParties; this.partie = partie; }
public ViewPartieListPage(int state) { InitializeComponent(); this.state = state; this.partieStatPage = null; this.scoreParties = null; this.partie = null; }