Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF/MVVM - How To Make A Chess Board

WPF/MVVM - How To Make A Chess Board

Scheduled Pinned Locked Moved WPF
wpfcsharpcsswcfarchitecture
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    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.

    L M 2 Replies Last reply
    0
    • K Kevin Marois

      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.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      That's what I like about MVVM: use it even if it doesn't make sense.

      1 Reply Last reply
      0
      • K Kevin Marois

        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.

        M Offline
        M Offline
        Meshack Musundi
        wrote on last edited by
        #3

        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 its ItemsPanelTemplate. If you use an items control that enables you to select an item then even better, like a ListBox.

        "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"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups