Intro I have a WPF application. When i click/double click on a button to show next screen, this is captured with both MouseLeftButtonDown and MouseLeftButtonUp. - MouseLeftButtonDown is making the button darker - MouseLeftButtonUp is sending me to next screen
The problem: If i "spam" or sometimes just click 2-3 (we say 3 times in this case) times on the button, it's start loading the next screen. When the next screen is shown, two mouse clicks is left in the queue and if the mouse is over another new button at the second screen, this is clicked on.
I tried with stuff like:
void LayoutRoot_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
Mouse.OverrideCursor = Cursors.Wait;
if (this.IsVisible && this.IsLoaded)
OnButtonPatient();
}
but both properties is set to true. I guess thats right since i can see the button when the mouse event triggers. The events can be explained like:
- 3 mouse clicks
- mouse cursor = waiting cursor
- next screen is loaded
- mouse cursor = normal
- mouse cursor = waiting cursor
- next button is clicked
How can i handle this? I dont want mouse event that happend on a previously screen follow on to my next screen. Greetings!