Hi,

In my application I need a 'map' of hexagonal tiles, arranged into a 'square' (as much as that is possible) of arbitrary size. The hexagons need to be 'clickable' by the user so they'll need to be some kind of element that supports click events.

This is what I'm looking for:


The number of tiles should be variable, sometimes I'll need 5x5, sometimes 25x25, etc. The square should then resize according to the size of the window (so more tiles doesn't mean larger size square, just smaller tiles).

I have no clue how to even start this. Since I come from windows forms I'm inclined to just create a new control that inherits Canvas and draw the whole thing manually, including click-position detection. That would probably work (in about 3 years time...) but I have a feeling this is much easier in WPF. Maybe some kind of ListBox with a funky ItemTemplate? I have made custom item templates before and I can probably get the items hexagonal, but I have no clue how I'm going to get them to line up in a square instead of just in a list as the ListBox usually does...

Any idea's?