views:

25

answers:

1

In order to learn silverlight on WP7 I'm playing with it around and well, I can't say I'm having sweet times here. I'm developing a simple, yet ugly Mine game (like windows's ^^).

The problem is that I'm gonna use a button for each case on the mines board, but I can't manage to find a way to preview a grid with cells containing my buttons.

I took the Grid component and I'm digging its properties but can't find a way to get a cell and set the button I want it to render, I've seen the RowDefinition/ColumnDefinition collections but I need cells not rows/columns, how could I render a grid of buttons guys ?

Maybe another component I could use ? PS: the size of my mine board is dynamic

+2  A: 

The cells don't really exist in XAML. When you define a button, you simply need to tell it where to sit.

<button x:Name="button0_0" Grid.Row="0" Grid.Col="0" />

This will be a button in the top left corner (it is a 0 indexed double array).

mattmoon9
got it, thank you
Miloud B.