Extended execution not working properly?

后端 未结 2 1715
小鲜肉
小鲜肉 2020-12-18 19:25

I\'m not able to get ExtendedExecution to work properly. The problem is that the Revoked event is not being fired until the execution is finished.

2条回答
  •  一整个雨季
    2020-12-18 20:26

    The usage of the await and Task is causing that your continued Task remains on the main thread making you have to wait with the black screen. Remember that the await behavior is to schedule the execution into the Dispatcher, NOT to begin a new thread, NOR schedule its execution into the ThreadPool. As consequence, No more UI messages can be processed until the Delay() ends.

    Just perform your time-consuming operation on a new thread, but ensure to keep the session open until it ends.

    Take a look of this https://msdn.microsoft.com/en-us/magazine/jj991977.aspx to get a good insight about how execution is sheduled

提交回复
热议问题