When I try your code, the UI is blocked the whole time, even with MaxDegreeOfParallelism = 1
. That's because all your block does is to call Invoke()
, which blocks the UI thread.
It's possible that under some circumstances, one thread calling Invoke()
over and over won't be enough to block the UI thread completely, but 2 threads almost certainly will.
So, what you're trying to do doesn't make any sense. You're not going to gain anything from using dataflow, or anything similar.
What you should do to fix this is not to have thousands of items in the UI. No human is going to go though such huge list anyway.