I have a ListBox, I populate it with ItemsSource
with List
.
But when I delete or add new control for this List, I need every tim
Instead of using a List
, use an ObservableCollection
. It is a list that supports change notifications for WPF:
// if this isn't readonly, you need to implement INotifyPropertyChanged, and raise
// PropertyChanged when you set the property to a new instance
private readonly ObservableCollection items =
new ObservableCollection();
public IList Items { get { return items; } }