Manually updating WPF data

I have a List <Foo> from a non-WPF assembly that I am trying to bind to a binding to WPF <ListBox>. Initially, the list items are displayed correctly, but when I add a new item to the <Foo> list, the list does not add the list item. How can I specify in the list box to relink / update / update data and show a new item?

+3
source share
3 answers

Although using an ObservableCollection is the best way to answer the actual question, the manual update method is to call BindingExpression.UpdateTarget

+10
source

ObservableCollection, .

+4

. ObservableCollection, BindingExpression.UpdateTarget. , . WPF, , , , . , , . ( !) , .

+2

Source: https://habr.com/ru/post/1706977/


All Articles