c# - want the disptacher to call a method right after eventhandler finished -


i have wpf usercontrol handles events combobox. control subscribes comboboxes' dropdownclosed event. i'm facing problem, combobx base implementation peforms unpleasant default code, after running through handler.

i know if there's way place code, "synchronous" after handler finished.

i found out common way using begininvoke:

void oncomboboxdropdownclosed() {     ...     dispatcher.begininvoke(dispatcherpriority.normal, new action(() => mycodeafterhandlerfinished())); } 

i don't think need (because msdn tells me runs asynchronously), best practice ?

more explained: 1) notified when dropdownclosed() fired combobox base (this event can seen condition "mycode()") 2) wait until combobox base implementation has run through invocation list , has dispatched event subscribers. 3) run mycode() --> how place mycode using invoke / begininvoke ?


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -