private void solvePuzzle(object sender, RoutedEventArgs e)
        {
            randomProgress.Visibility = Visibility.Visible;
            BackgroundWorker worker = new BackgroundWorker();
            pz = new PuzzleGenerator();
            buttonControl(false);
            worker.DoWork += backgroundWorkerDoWork;
            worker.RunWorkerCompleted += backGroundWorkerCompleted;
            worker.RunWorkerAsync();

            results.Clear();
        }
 private void reallyGeneratePuzzle(object o, DoWorkEventArgs e)
 {
     PuzzleGenerator pz = new PuzzleGenerator();
     e.Result = pz.randomPuzzle((int)e.Argument);
 }