I have a list box with its itemtemplate set to contain checkboxes. How do I retrieve the checkboxes through an event after having set the itemsource on the listbox.
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
(sender as ListBox).Items ----- this is the itemssource
How do I get the check box object?????
}
Thanks in advance.
Person.

Piotr Justyna70 reputationPosted Dec 9, 2009, 6:22 AM EST
Why do you want to retrieve children collection from "sender" object, since you already have it in the code? "People" property is already bound to your listbox :)
Martin Cook46 reputationPosted Feb 10, 2010, 2:40 AM EST
Would definitely be worth swatting up on WPF Databinding: -
http://msdn.microsoft.com/en-us/library/aa480224.aspx
Cheers,
Martin