The MouseUp event is not fired on clicking the button.
Because the first fires is an event at the Button.Click
, and when it works, it conflicts with the event MouseUp
. Quote from here:
ButtonBase inherits from UIElement, a Button will also have access to all of the mouse button events defined for UIElement. Because the Button does something in response to button presses, it swallows the bubbling events (e.g. MouseLeftButtonDown and MouseDown). You can still detect these lower level button press events by adding handlers for the tunneling events (e.g. PreviewMouseLeftButtonDown and PreviewMouseDown).
Try to replace the Button
on Label
, and you'll get the desired result: