0

I have a RepeatButton on a UserControl that acts as the up button. The control is a number spinner of sorts. When the number value goes from 9 to 10 the up button is released because it moves out from under the mouse. I know I can capture the mouse, but my RepeatButton is not giving me MouseLeftButtonDown events. So how do I capture the mouse over the RepeatButton when it is depressed and release the capture when it is released? And should the RepeatButton give me MouseLeftButtonDown events?

Edits:

It would seem that the template content is stealing the button's MouseLeftButtonDown events. Is there anyway I can circumvent the button's content. If I set HitTestVisible to false, the button itself becomes untouchable. I wish silverlight had OnPreview overrides.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
Jordan
  • 9,642
  • 10
  • 71
  • 141

2 Answers2

0

I just had a similar problem with Windows 8/WinRT and found a workaround - you can bind something to the button's IsPressed property and when it gets set to false - it means the button/touch is up.

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
0

Have you tried utilising MouseLeftButtonUp instead to check if it can occur when the mouse button is released?

Christian
  • 167
  • 3
  • 13