WPF/MVVM - How To Make A Chess Board
-
What's the best way to make a Chess board using WPF and MVVM? On startup I want to create an 8x8 grid of Squares. Right now I added all 64 Sqaures to a in the XAML. But to make this work with MVVM I'll need some form of binding. Not sure of how to architect this. Anyone?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
What's the best way to make a Chess board using WPF and MVVM? On startup I want to create an 8x8 grid of Squares. Right now I added all 64 Sqaures to a in the XAML. But to make this work with MVVM I'll need some form of binding. Not sure of how to architect this. Anyone?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
What's the best way to make a Chess board using WPF and MVVM? On startup I want to create an 8x8 grid of Squares. Right now I added all 64 Sqaures to a in the XAML. But to make this work with MVVM I'll need some form of binding. Not sure of how to architect this. Anyone?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Kevin Marois wrote:
What's the best way to make a Chess board using WPF and MVVM?
I asked myself the same question before working on StockChess[^] and I'm guessing you've figured out by now that the approach you've mentioned will not get you the result you want. If you want it to be MVVM friendly you will just have to create an items control that uses a
Grid
for itsItemsPanelTemplate
. If you use an items control that enables you to select an item then even better, like aListBox
."As beings of finite lifespan, our contributions to the sum of human knowledge is one of the greatest endeavors we can undertake and one of the defining characteristics of humanity itself"