c# - How to dispatch a lambda expression to a background (non-UI) thread? -


i looking perform action:

deployment.current.dispatcher.begininvoke(() =>         {             ... // ui specific stuff         }); 

but instead of sending lambda expression ui thread, want send background worker.

the situation such, have messagebox response need have know whether or not additional processing (in case copy file).

how can 1 accomplish this? open refactor solution of sorts not include lambda expression dispatch.

thanks reading

messagebox runs on ui thread, when returns modal display, you're on ui thread. dispatching ui dispatcher @ point doesn't make sense.

you'd want run lambda on background thread (e.g., threadpool.queueuserworkitem, via task, etc), when finishes use dispatcher return ui thread. need dispatcher ui thread; not sure if different 1 mention in code.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -