BUB
BUB

Reputation: 73

Disable mouse clicks on displaying busy/wait cursor in WPF

I am currently displaying a busy/wait cursor using Mouse.OverrideCursor = Cursors.Wait. But when the wait cursor is on it is still able to recognize the mouse clicks happened during that time. Is there any way to disable the mouse clicks?

Upvotes: 4

Views: 2922

Answers (1)

pulp
pulp

Reputation: 708

this.IsHitTestVisible = false;

but a more elegant solution would be (assuming you are using MVVM pattern) to reject the mouse click in the RelayCommand CanExecute method.

Upvotes: 5

Related Questions