For years I\'ve developed with Winforms, now I want to switch to WPF and make a chessboard. Unfortunately I have no idea where to start. Using WPF makes me very unsure, I\'m
Chess seems like a good fit for WPF's MVVM code pattern.
The Model will be the logic for the game of chess, sounds like you have that under control. The View will the the WPF look of the game, and the ViewModel will the representation of the game, in which the View can databind to.
For the view, an ItemsControl using a UniformGrid will work for a 2D representation of the game.
Here's a start (unchecked)
For the above to work, your ViewModel will need to have a ObservableCollection
and ChessGridItem
should be a DependencyObject
exposing DependencyProperties for SquareColor
, PieceColor
and PieceShape