display Hourglass when application is busy

前端 未结 9 1628
说谎
说谎 2020-11-28 03:01

For a view constructed using WPF, I want to change the mouse cursor to a hourglass when the application is busy and nonresponsive.

One solution is to add



        
9条回答
  •  春和景丽
    2020-11-28 03:24

    The best way would be to not cause the UI to become non-responsive ever, offloading all of the work to other threads/tasks as appropriate.

    Other than that, you're kindof in a catch-22: if you did add a way to detect that the ui is non-responsive, there's no good way to change the cursor, as the place you'd need to do that (the even thread) is non-responsive... You might be able to pinvoke out to standard win32 code to change the cursor for the whole window, though?

    Otherwise, you'd have to do it pre-emptively, like your question suggests.

提交回复
热议问题