private void CreateViewSolution() { ViewSolution = new ObservableCollection <CellItem>(); List <Cell> solution = MazeSolver.FindSolution(Maze); foreach (CellItem cellItem in ViewCells) { if (solution.Contains(cellItem.Cell)) { ViewSolution.Add(cellItem); } } }
private void CreateViewCells() { ViewCells = new ObservableCollection <CellItem>(); double graphicsSize = MazeCanvasSize / (double)Size; List <Cell> solution = MazeSolver.FindSolution(Maze); for (int row = 0; row < Maze.RowsCount; row++) { for (int column = 0; column < Maze.ColumnsCount; column++) { Cell cell = Maze[row, column]; CellItem cellItem = new CellItem(cell) { TopLocation = row * graphicsSize, LeftLocation = column * graphicsSize, Width = graphicsSize, }; ViewCells.Add(cellItem); } } }