I have one of my CPU intensive tasks blocking the UI thread, after investigating I've found that the root of the problem seems to be the Task.Run actually running in the Dispatcher thread:
Task.Run(() =>
{
if (Dispatcher.CurrentDispatcher.Thread == Thread.CurrentThread)
{
// breakpoint
}
});
Placing a breakpoints in the if statement is hit.
Is this expected behaviour? I understood Task.Run to use a different thread.