c# - Not able to run BusyIndicator with BackgroundWorker in Wpf -
i have 2 windows. mainwindow , window busyindicator. i'm using backgroundworker , dispatcher work (calculation , ui) in main window, while want show busyindicator. window shows without busyindicator.
busyindicator_window busy = new busyindicator_window(); busy.show(); backgroundworker worker = new backgroundworker(); worker.dowork += (o, ea) => { dispatcher.invoke((action)(() => { plot.plot_mv.startanke(selectedfilepath, lw); })); }; worker.runworkercompleted += (o, ea) => { busy.busyindicator.isbusy = false; }; busy.busyindicator.isbusy = true; worker.runworkerasync();
is there got wrong? thanks
a background worker delegates ui thread pretty useless. work want do:
worker.dowork += (o, ea) => { plot.plot_mv.startanke(selectedfilepath, lw); };
Comments
Post a Comment