private void Generate_Maze(object sender, RoutedEventArgs e) { Maze.Children.Clear(); Maze.RowDefinitions.Clear(); Maze.ColumnDefinitions.Clear(); MazeCell[,] grid = CreateGrid(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight)); maze = new MazeContent(grid); maze.GenerateMaze(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight)); }
public MainWindow() { InitializeComponent(); MazeInfo = new MazeInfo(); MazeInfo.MazeWidth = "20"; MazeInfo.MazeHeight = "20"; this.DataContext = MazeInfo; MazeCell[,] grid = CreateGrid(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight)); maze = new MazeContent(grid); maze.GenerateMaze(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight)); }