2

I'm working in Silverlight. I've got a ListBox that's being loaded dynamically. In the listbox, i want to put a checkbox that's tied to the listbox's "selected" property. I can't quite figure out how this is done. Can anyone point me in the right direction? If this were a winform thing, I would, create "OnChecked" handler for the checkbox to find the parent of the checkbox and set it to selected. I'm working on the notion that there is a better way. Thanks.

Irwin
  • 12,551
  • 11
  • 67
  • 97

2 Answers2

3

Silverlight 2 does not offer support for what they call Element to Element Binding.

This feature has been added to Silverlight 3 which is currently in Beta. Silverlight 3 is available at http://silverlight.net/getstarted/silverlight3/default.aspx

bendewey
  • 39,709
  • 13
  • 100
  • 125
0

Nope.

In WPF you could do it by putting something the following on your CheckBox:

Checked="{Binding Source=Listbox.SelectedItem, Path=Something, Converter={StaticResource SomeConverter}}"

But, sadly, Silverlight 2 does not support binding to other controls using Source=.

In other words, there is no better way at this point in time. Code is all you've got.

Cory R. King
  • 2,766
  • 1
  • 24
  • 22