3 ms·
> the dispatcher paradigm is one of the thing I dislike the most about coding UI stuff in .Net It inherits it from Windows. As far as I know, most GUIs have a
by zamalek 11y ago
> the dispatcher paradigm is one of the thing I dislike the most about coding UI stuff in .Net
It inherits it from Windows. As far as I know, most GUIs have a dispatcher because <technical reasons>. I definitely think that there could have been a better way to solve the problem (method interception), however, I think that TPL does add value.
In your case you cited intense IO as one reason to call `.ConfigureAwait(false).` The thing is: you have made a conscious decision to not return to the UI thread and therefore are more likely to tread carefully when writing the remainder of the method. `.ConfigureAwait(false)` declares "dragons be here."
Previously someone who didn't know better would update the UI from the wrong thread, weird things happen and they don't know why.
Here's something to make things simpler for you: https://gist.github.com/jcdickinson/f875229e671710cf1b34 https://gist.github.com/jcdickinson/f875229e671710cf1b34
- asveikau 11y ago> It inherits it from Windows. As far as I know, most GUIs have a dispatcher because <technical reasons>. This is a kind of lame elision. The classical Windows UI threading model is that every window has an owning thread [the thread it was created on], and that owning thread is supposed to drain its message queue periodically. You can send messages to another thread's object [either in blocking, via SendMessage, or enqueue without blocking for result, via PostMessage].