Am Using the checkbox in listbox items, how to get the selected checkboxes from the list
You could move the data context for each of these items away from the UI and create an ObservableCollection of objects
public ObservableCollection List { get;set;}
public class CheckedItem : INotifyPropertyChanged
{
private bool selected;
private string description;
public bool Selected
{
get { return selected; }
set
{
selected = value;
OnPropertyChanged("Selected");
}
}
public string Description
{
get { return description; }
set
{
description = value;
OnPropertyChanged("Description");
}
}
/* INotifyPropertyChanged implementation */
}
Then in your ListBox ItemTemplate
Your selected items are now available in the ObservableCollection rather than looping through UI elements