c# - silverlight 4 - fastest/simplest way of scheduling work on the UI thread? -


ui tree:

  • listbox april 2010 toolkit's listboxdragdroptarget
  • listbox item template includes control has a couple of buttons
  • the click handler in question in 1 of buttons (and therefore part of actual listboxitem in ui, potential drag-drop operation)
  • the overall listbox item should able drag (to rearrange within listbox, or move listbox), goal keep click handlers on these buttons triggering drag

currently click handler on 1 of buttons (see above) appears take long enough (it bunch of updates viewmodel, cause various other ui changes, needs on ui thread afaict) causes drag event start.

the first thought on getting code out of click handler create backgroundworker no dowork , put in runworkercompleted. however, feels both abuse of backgroundworker , kind of heavyweight. effect want akin postthreadmessage on same thread (the ui thread) i'm not seeing jump out @ me how quickly.

i queue threadpool or new thread , have marshal on ui thread, again seems quite abuse.

i think dispatcher.begininvoke low dispatcherpriority behaves postthreadmessage.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -