I have a listbox with datatemplate, with 2 textblocks which binding some properties of some class,i have a list with elements of type of that class,i want to dynamically show this elements i.e at first show first 20 elements, than next 20 and etc, but how can I do that, to itemsource I can only assign a list, I can’t add elements to it dynamically, please help me.
I have a listbox with datatemplate, with 2 textblocks which binding some properties of
Share
In order for a
ListBoxto update dynamically as items are added to the list, you need to choose a collection class that raises events when items are added / removed. You should useObservableCollectionas yourItemsSource. This collection raises theCollectionChangedevent when it is modified.ListBoxhandles this event and updates accordingly.