c# - Why does the BackgroundWorker's ProgressChanged event work without calling RunWorkerAsync? -
i have question regarding backgroundworker
. can call progresschanged
event without having started thread runworkerasync
.
i don't understand why works. how can notify original thread if new thread didn't start yet?
this seems work regardless, since updates gui without problem, wasn't before implemented backgroundworker
.
calling reportprogresschanged()
raise progresschanged
event regardless of thread called from.
inside inplementation of reportprogresschanged()
mechanism raises event on ui thread if wasn't called ui thread. if reportprogresschanged()
is being called ui thread, raises event without needing marshalling.
Comments
Post a Comment