Esempio n. 1
0
        private void NewPuzzleGrid()
        {
            if (_puzzleGrid != null)
            {
                PuzzleHostingPanel.Children.Remove(_puzzleGrid);
            }
            _puzzleGrid = new PuzzleGrid();
            _puzzleGrid.PuzzleWon += delegate(object sender, EventArgs e)
            {
                StatusLabel.Content = "Got it!!!";
            };

            _puzzleGrid.MoveMade += new EventHandler<HandledEventArgs>(OnMoveMade);

            _puzzleGrid.IsApplyingStyle = _stylingPuzzle;
            _puzzleGrid.NumRows = _numRows;

            _puzzleGrid.ElementToChopUp = _elementToChopUp;
            _puzzleGrid.PuzzleSize = _puzzleSize;

            _puzzleGrid.ShowNumbers(ChkShowNumbers.IsChecked.Value);

            _puzzleGrid.ShouldAnimateInteractions = ChkShowAnimations.IsChecked.Value;

            PuzzleHostingPanel.Children.Add(_puzzleGrid);
            StatusLabel.Content = "New " + _numRows + "x" + _numRows + " game";
        }
Esempio n. 2
0
        private void NewPuzzleGrid()
        {
            if (_puzzleGrid != null)
            {
                PuzzleHostingPanel.Children.Remove(_puzzleGrid);
            }
            _puzzleGrid            = new PuzzleGrid();
            _puzzleGrid.PuzzleWon += delegate(object sender, EventArgs e)
            {
                StatusLabel.Content = "Got it!!!";
            };

            _puzzleGrid.MoveMade += new EventHandler <HandledEventArgs>(OnMoveMade);

            _puzzleGrid.IsApplyingStyle = _stylingPuzzle;
            _puzzleGrid.NumRows         = _numRows;

            _puzzleGrid.ElementToChopUp = _elementToChopUp;
            _puzzleGrid.PuzzleSize      = _puzzleSize;

            _puzzleGrid.ShowNumbers(ChkShowNumbers.IsChecked.Value);

            _puzzleGrid.ShouldAnimateInteractions = ChkShowAnimations.IsChecked.Value;

            PuzzleHostingPanel.Children.Add(_puzzleGrid);
            StatusLabel.Content = "New " + _numRows + "x" + _numRows + " game";
        }