I am working on a WP7 app in the emulator.
I have a page with two rectangles on it, rect1 and rect2. rect2 overlaps rect1.
<Rectangle Name="rect1" Grid.Row="1" Width="200" Height="200" Fill="Aqua" MouseLeftButtonDown="rect1_MouseLeftButtonDown" MouseLeftButtonUp="rect1_MouseLeftButtonUp" />
<Rectangle Name="rect2" Margin="100,100,0,0" Grid.Row="1" Width="200" Height="200" Fill="Red" MouseLeftButtonUp="rect2_MouseLeftButtonUp" Visibility="Collapsed" />
When I click on rect1 it receives a mouse-down event and in the code for this event I make rect2 visible. The mouse is then over the newly visible rect2. I release the mouse button, and wait for the mouse-up event on rect2.
rect2 does not receive a mouse up event.
Neither does rect1.
Neither does the page.
Where has the mouse-up event gone?
It turns out this is the expected behaviour and there is no rule that says for every mouse-down event there should be a corresponding mouse-up event.
I solved my problem by using the manipulation events: