Hello to all! Split into layers: Model - classes "player", "field", and probably "gameplay". View - the window itself. But about the intermediary, it is clear that he will process the action on the dataGridView and change the object accordingly and display the changes in this object in the window.
The question is how to implement this logic in general and what pattern or “technique” to choose for this implementation?
Thank you in advance)

  • MVVM yes, but DataGridView is not designed for this, it is for displaying tables, and you have a square matrix, these are different things, although they look similar. - rdorn

1 answer 1

1) Probably not a dataGridView will be needed, but this panel will give UniformGrid cells of the same size, although you can get along with a regular grid.

2) Work with cells (their state, appearance) will need to be organized through custom DataTemplate.

3) As an intermediary - the ViewModel class, which for your View will be a DataContext.

What else to say? There will not be an answer to one page.