public void createGrid(PuzzleGame mw) { this.mw = mw; int numPiece = 1; for (int i = 0; i < n; i++) { ColumnDefinition gridCol1 = new ColumnDefinition(); RowDefinition gridRow1 = new RowDefinition(); this.gridMatriz.ColumnDefinitions.Add(gridCol1); this.gridMatriz.RowDefinitions.Add(gridRow1); } for (int i = 0; i < this.gridMatriz.RowDefinitions.Count; i++) { for (int j = 0; j < this.gridMatriz.ColumnDefinitions.Count; j++) { PiecePuzzle piece = new PiecePuzzle(); piece.Puzzle = this; piece.Num = numPiece; numPiece++; Grid.SetRow(piece, i); Grid.SetColumn(piece, j); this.gridMatriz.Children.Add(piece); } } this.sourceImage(); }
private void selectPuzzle(object sender, RoutedEventArgs e) { this.sensorChooser.Stop(); this.Hide(); int aux = Int32.Parse(((KinectTileButton)sender).Tag.ToString()); PuzzleGame mw = new PuzzleGame(aux, this); mw.Show(); }