multithreading - How WPF Multi threading works? -
i knew basic building blocks of multithreading in wpf, have question quite confusing me.
wpf applications start 2 threads:
one handling rendering , managing ui.
this sounds good,but ui thread bothering me, ui thread nothing application thread
the thread creates wpf ui element owns elements , other threads can not interact ui elements directly,this known thread affinity.
say,i have 2 text box , 1 button in myapplication , each text box have own dispatcherobject ,on button click i'll update textbox values,hope this'll done ui thread.
1.now,my question ui thread application thread, button have own dispatcherobject , two text boxes have own dispatcherobject, how ui thread has own dispatcherobject , different these ui controls dispatcherobject can update textboxes?
- my question is, if create new textbox in background thread can update text box ui thread?
please correct understanding,i couldn't proceed further.
each dispatcherobject associated ui thread. thread can access particular dispatcherobject. in sanely architected wpf app there 1 ui thread. elements created , accessed there.
you can have multiple ui threads distinct sets of elements esoteric scenario brings lot of issues.
if create new textbox in background thread
that text box bound background thread , used there. therefore not hook main element tree. useless.
Comments
Post a Comment