void Initialize(CellBoard cellBoard) { Cells = TwoDimensionalArrayExtension.Create<CellView>(cellBoard.ActualCells.Size()); cellBoard.ActualCells.ForEach((point, cell) => { var cellView = new CellView { Point = point, DataContext = cell }; cellView.IndexChanged += OnCellViewIndexChanged; Cells.Set(point, cellView); }); }
void Initialize(CellBoard cellBoard) { Cells = TwoDimensionalArrayExtension.Create <CellView>(cellBoard.ActualCells.Size()); cellBoard.ActualCells.ForEach((point, cell) => { var cellView = new CellView { Point = point, DataContext = cell }; cellView.IndexChanged += OnCellViewIndexChanged; Cells.Set(point, cellView); }); }
void OnCellViewIndexChanged(CellView cellView) { using (var graphics = CreateGraphics()) { cellView.Paint(graphics); } }