That’s probably as good of a way as any. There is no programatic way to know of a cancelable, time-consuming task is running. And there isn’t any programatic way of canceling one, even if you did know there was one running.
I had hoped that you would exposed the Background Worker or Cancellation
Token or Task object’s “Cancel” mechanism. But this is working for now.
Thank you.