wpf - why Dispatcher.invoke() not working? -
whenever change occured changes call set_filelist_inventory(). , send new list function ui not upadating.
public partial class inventory : usercontrol { public list<string> file_list = new list<string>(); public void set_filelist_inventory(list<string> x) { if (file_list.sequenceequal(x)) { } else { file_list = x; dispatcher.invoke(() => { listview1.itemssource = file_list; }); } } public inventory() { initializecomponent(); file_list = general.getfilelist(); discover d = new discover(); d.send(d); listview1.itemssource = file_list; } }
i tried removing if else block. still didn't worked.
Comments
Post a Comment