I think that there are different ways to accomplish what you are trying. But based on what you are trying to do, I think that you would be fine just using async/await which is not going to block your UI for sure, and will allow you to control your task asynchronously.
As MSDN says:
Async methods are intended to be non-blocking operations. An await
expression in an async method doesn’t block the current thread while
the awaited task is running. Instead, the expression signs up the rest
of the method as a continuation and returns control to the caller of
the async method. The async and await keywords don't cause additional
threads to be created. Async methods don't require multithreading
because an async method doesn't run on its own thread. The method runs
on the current synchronization context and uses time on the thread
only when the method is active. You can use Task.Run to move CPU-bound
work to a background thread, but a background thread doesn't help with
a process that's just waiting for results to become available.
https://msdn.microsoft.com/en-us/library/mt674882.aspx
This is an example of usage:
public async Task MyMethodAsync()
{
Task<int> runTask = RunOperationAsync();
int result = await longRunningTask;
Console.WriteLine(result);
}
public async Task<int> RunOperationAsync()
{
await Task.Delay(1000); //1 seconds delay
return 1;
}
This won´t block your UI