private void Form1_Load(object sender, EventArgs e) { //Maak een 2D array die alle pictueboxes aan een index linkt. PictureBox[,] pictureBoxes = new PictureBox[4, 4]; pictureBoxes[0, 0] = spelPbKaart00; pictureBoxes[1, 0] = spelPbKaart10; pictureBoxes[2, 0] = spelPbKaart20; pictureBoxes[3, 0] = spelPbKaart30; pictureBoxes[0, 1] = spelPbKaart01; pictureBoxes[1, 1] = spelPbKaart11; pictureBoxes[2, 1] = spelPbKaart21; pictureBoxes[3, 1] = spelPbKaart31; pictureBoxes[0, 2] = spelPbKaart02; pictureBoxes[1, 2] = spelPbKaart12; pictureBoxes[2, 2] = spelPbKaart22; pictureBoxes[3, 2] = spelPbKaart32; pictureBoxes[0, 3] = spelPbKaart03; pictureBoxes[1, 3] = spelPbKaart13; pictureBoxes[2, 3] = spelPbKaart23; pictureBoxes[3, 3] = spelPbKaart33; //Maak een nieuwe page controller aan. pageController = new PageController(mainTabControl, 0); //Maak een nieuwe hoofdmenu aan. hoofdmenuPage = new HoofdMenuPage(hmLbPlayers, hmTbPlayername); //Maak een eind pagina aan. endGamePage = new EndGamePage(endLblWinners); PlayingField playingField = new PlayingField(pictureBoxes, 4, 4, 2); //Maak een nieuwe spel pagina aan. gamePage = new SpelPage( pageController, endGamePage, playingField, spelTimerTurn, spelTimerUpdate, spelTimerResetCards, spelLvSpelers, spelLblTurn, spelLblTime ); highscorePage = new HighScorePage(hsLvList); }
public void ChangePageToHighScorePage() { var page = new HighScorePage(); ((MainWindow)Application.Current.MainWindow).Main.Content = page; }