Cancellable UI loader
You should be using a CancellationToken, which can be generated like:

CancellationTokenSource source = new CancellationTokenSource();
CancellationToken token = source.Token;


Pass this token to the method you wish to potentially cancel and keep a reference outside the method.  Then, from the calling method you can check token.IsCancellationRequested at periodic intervals and return, or if you wish to throw, you can call token.ThrowIfCancellationRequested().  To signal a cancellation, you call source.Cancel(), which propagates through to the token and signals a cancellation request.  You can also set it up to automatically cancel after a certain amount of time when you create the CancellationTokenSource.