tags:

views:

32

answers:

1

What would be the best way to get button parameters when my button is in an array

 class myButtonproprties
{
 int x;
 int y;
} 

where i use it as:

   myButtonproprties array[][];

I am new to WPF and I have heard about the dependency property mechanism and didn't understand it

would it be helpful here?

EDIT:

let's say i am already binded to a collection and then i want my logic to work for example

                <Button 
    text="{Binding Path=byttonInfo}"
   Width="50" 
    Height="50">

i want the button to be with no text on it and to use button informaion as my logic let's say my game is chackmate and every pieace hold information when the button is clicked i want to know who he is in order for my code behind logic to decide if he should move .

if he does what should i do then ' if i change is picture would the UI handle it ? in which thread ?

you can see my motivation to this question here : http://stackoverflow.com/questions/3871467/memory-card-game-wpf-problem

A: 

If your question means "How do I bind to a models' property when it is in an indexed collection?" then the answer is simple.

<TextBlock Text="{Binding myButtonCollection[0][1].X}" />
<TextBlock Text="{Binding myButtonCollection[0][1].Y}" />

WPF binding allows indexed binding to collections, eg. Lists, arrays, dictionaries.

If this is not your answer, then you need to word your question better.

Tri Q