views:

35

answers:

1

I need to create the following WPF application:

  1. A main window with a square grid in it.
  2. The grid should have a large amount of cells in it (for example: [1000x1000]), each cell being painted black or white.
  3. A "Robot" object should be able to walk on the grid from cell to cell.

I thought of using a Uniformgrid object, but I suspect that applying the "cell logic" for each cell for a grid as big as [1000x1000] would create massive overhead. Since basically, my grid is made out of "cells", I thought of using an InkCanvas class, thus each cell is actually a pixel on screen. But than where do I put the "logic" behind each cell? How do I make my "Robot" class read pixel coordinates from the pixel he is currently on, or read the information from neighbour pixels?

To conclude, I don't know what sort of object class to use as a grid for my application.

A: 

You can check out CodePlexes WPF Toolkit's data grid control. It should be able to handle 1000x1000 and has custom options for background color and even images within the cells. I'm not sure how well the performance would be once it was setup, but it would be fairly easy to implement.

If it were me programming it that's what I would try first.

jsmith