Search code examples
wpfchess

Chessboard in WPF


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 feeling like a noob again. Can someone outline a basic design? I guess I would start with a 8x8 Grid and use rectangles for the squares, images for pieces. And then? Am I missing something?

Edit: It's just about the user interface; what goes on behind the scenes is no problem.


Solution

  • An alternative to the standard grid, is the use of a UniformGrid (msdn link).

    It's probably more suited to this (in my opinion) as it will ALWAYS give you the same size cells.

    used ala:

    <UniformgGrid Columns="8" Rows="8">
        <Control1/>
        <Control2/>
        <Control3/>
    </UniformGrid>
    

    any of these answers will give you the results you desire.