views:

219

answers:

1

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.

+1  A: 

maybe needs to set the application-wide cursor as well

Mouse.OverrideCursor = Cursors.Wait
jspcal
Set Mouse.OverrideCursor as shown above to display the wait cursor; set it to null to clear the wait cursor and return to the default cursor.
David Veeneman

related questions