views:

42

answers:

2

Hello, someone can suggest how I can do it?

I have a public static int _index in App.xaml.cs

I have a List < List < Person > >

foreach List < Person > I create a new button

-> foreach button, the click.event of it opens a PopUp.

Now I want to bind the Textboxes of the PopUp to the person-propertys

For example:

PopUp of Button 1 should bound to List[1][_index]

PopUp of Button 2 should bound to List[2][_index]

AND:

if the _index is changed, the content of the Textboxes should change too.

Thanks

+1  A: 

Bind your List to a ListBox and change the ItemTemplate.

Jay
I can't use a ListBox.
Juono
You'll need to provide a little more context than that to get a helpful answer. Why won't a listbox work for you?
Jay
I need real buttons. Every button simulate a sensor, for example change the color oder position. If I click the "sensor", the popUp shows me the data of the sensor. thanks
Juono
Take another look at ListBox and the ability to modify how each ListBox item is rendered by customizing the ItemTemplate. Silverlight's ListBox is not like Windows Forms, it's fully customizable. You can have each list item rendered using a button and have a click event on the button. The link I posted above has a detailed example of this, give it a read!
Jay
A ListBox with a proper ItemTemplate is what you need. Please read that link because it's one of the most basic and important things in Silverlight/WPF. You won't go far without a solid understanding of this part.
Francesco De Vittori
A: 

Seems like you need to use a Converter for this.

jeffo