private void DrawTheBoard(Grid uiBoardToDraw, MinConflictAlgorithm chessBoard)
        {
            Dispatcher.Invoke(() =>
            {
                uiBoardToDraw.ColumnDefinitions.Clear();
                uiBoardToDraw.RowDefinitions.Clear();
                uiBoardToDraw.Children.Clear();


                for (int i = 0; i < chessBoard.NumberOfQueens; i++)
                {
                    uiBoardToDraw.RowDefinitions.Add(new RowDefinition());
                    uiBoardToDraw.ColumnDefinitions.Add(new ColumnDefinition());
                }

                for (int i = 0; i < chessBoard.NumberOfQueens; i++)
                {
                    Ellipse queen = new Ellipse();

                    if (chessBoard.Conflicts[i])
                    {
                        queen.Fill = Brushes.Red;
                    }
                    else
                    {
                        queen.Fill = Brushes.Black;
                    }

                    int collumn = chessBoard.Board[i];

                    Grid.SetColumn(queen, collumn);
                    Grid.SetRow(queen, i);

                    uiBoardToDraw.Children.Add(queen);
                }
            });
        }
        private async Task SolveTheBoard(int numberOfQueens)
        {
            chessBoard = new MinConflictAlgorithm(numberOfQueens);
            chessBoard.Finish += chessBoard_Finish;

            await Task.Factory.StartNew(() => chessBoard.Solve());

            //return chessBoard;
        }