显示等待光标?
我想在我正在编写的 Prism 应用程序中的耗时过程中显示等待光标。我已使用 WaitCursorRequestEvent
复合事件将其连接起来。 'True' 表示显示等待光标,'false' 表示返回默认值。
Shell 订阅事件并使用以下事件处理程序处理它:
/// <summary>
/// Handles the WaitCursorRequest event.
/// </summary>
public void OnWaitCursorRequest(bool showWaitCursor)
{
// Set cursor
this.Cursor = showWaitCursor ? Cursors.Wait : Cursors.Arrow;
this.ForceCursor = true;
}
执行耗时进程的模块在启动进程时使用“true”有效负载发布事件,并使用“false”有效负载再次发布事件当它完成该过程时。
事件处理程序在这两种情况下都被调用——我通过设置断点进行了测试。但光标没有改变。知道我做错了什么吗?谢谢。
I want to show a wait cursor during a time-consuming process in a Prism app I am writing. I have wired it up using a WaitCursorRequestEvent<bool>
composite event. 'True' means show the wait cursor, 'false' means go back to default.
The Shell subscribes to the event and processes it using the following event handler:
/// <summary>
/// Handles the WaitCursorRequest event.
/// </summary>
public void OnWaitCursorRequest(bool showWaitCursor)
{
// Set cursor
this.Cursor = showWaitCursor ? Cursors.Wait : Cursors.Arrow;
this.ForceCursor = true;
}
The module that executes the time-consuming process publishes the event with a 'true' payload when it starts the process, and publishes the event again with a 'false' payload when it completes the process.
The event handler is being called on both occasions--I tested by setting a breakpoint. But the cursor isn't changing. Any idea what I am doing wrong? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能还需要设置应用程序范围的光标
maybe needs to set the application-wide cursor as well