views:

94

answers:

2

Hi I want to develop a game like Scrabble in WPF for which I need some suggestions

For Visuals: 1. What controls can be utilized to represent a (let's say 9 x 9) matrix? I would need ability to associate each cell with an id to know its state at all times during execution.

  1. How can I inject different visual properties to a cell of matrix?

  2. Would I need something like separate layers for base board, and tiles?

For logic: 4. How to go about validating a word and possible words around it?

Please advise. Thanks PJ

A: 

Consider building your Custom Layout manager.

All you need to do is override the MeasureOverride and ArrangeOverride methods:

public class ScrabblePanel : Panel
{
  protected override Size MeasureOverride( Size availableSize ) 
  {
     // your code here
  }

  protected override Size ArrangeOverride( Size finalSize ) {}
  {
     // your code here
  }
}
Zamboni
A: 

I've posted a Reversi game on Codeplex at http://correspondence.codeplex.com. I used triggers to data bind properties of a square to styles of a cell. The same technique should work for scrabble.

Michael L Perry