0

I would like to set the cursor to busy status when the button is clicked. In a Winform i would have changed the cursor in the click event and revert back after the click logic is executed. Now reading through few posts about Cursor in WPF , i just want to make sure if Setting the cursor property of the button (its in a UserControl) through xaml means -> show the cursor when the button is clicked! Thanks!

ioWint
  • 1,609
  • 3
  • 16
  • 34

1 Answers1

1

Setting the cursor property in XAML will change the Cursor everytime your mouse moves over it. What you want is Mouse.OverrideCursor to Cursors.Wait, but you have to do it in your code, not xaml. Which makes sense, if you want a wait cursor, your xaml usually don't know when your operation is finished, because you have to reset it to the previous state or clear it. See this post for further info.

Community
  • 1
  • 1
dowhilefor
  • 10,971
  • 3
  • 28
  • 45
  • Thanks! actually i read his question and got confused as he says it worked as expected in a Usercontrol but not in a WPF Page! – ioWint Aug 10 '11 at 23:41