Johannes Schacht
Johannes Schacht

Reputation: 1364

Cursor only shown as wait cursor when hovering over controls

I have bound the cursor to a property like this:

<UserControl.Cursor>
    <Binding Path="IsRunning" 
             Converter="{StaticResource BoolToRunningCursorConverter}" 
             UpdateSourceTrigger="PropertyChanged"/>
</UserControl.Cursor>

(BoolToRunningCursorConverter returns "Wait" or "Arrow").

It behaves basically as expected. The only thing is that the cursor is displayed as wait cursor only when hovering over one of the controls of the UserControl. When hovering over the empty background of the control it turns into a regular cursor. What can I do?

Upvotes: 1

Views: 119

Answers (1)

Toby Crawford
Toby Crawford

Reputation: 827

Mouse events don't work well over areas which have a null brush set as the background.

Set the background of the control to either a color or Transparent:

<UserControl Background="Transparent">...

Upvotes: 2

Related Questions