HoverProblem in WPF

by Geert 15. December 2010 15:02

Update: this issue is now posted to Microsoft Connect. Please vote for it.

We are working on quite a large problem, and had some users complaining that their windows disappeared as soon as they hovered a popup. But since the application is very big, and the users couldn't tell nor reproduce the problem, we were just ignoring them.

But then, a strange combination of user input actions made it happen at our place as well. This meant that we had to start a thorough investigation, but we couldn't get it reproduced. Until the day that I danced 3 times around my house during full moon, which is today (just kidding for the ones that don't understand sarcasm).

Here is a video showing the issue:

I also mad a demo application that shows the hovering bug that we encounter in WPF. I am not sure about the exact cause of the problem, but it seems to be a combination of a non-modal popup window and the web browser.

Problem description

When using the webbrowser control to load a PDF document, we found a very rare bug which was extremely hard to reproduce. However, we finally managed a way to reproduce the issue and hope that Microsoft (or someone else) can give us a clue in the right direction (or simply fix the bug).

How to reproduce

The demo application needs an existing PDF file as input. Then, there are several options to run the test. If you disable either one of them, you will notice that the problem will not occur. As soon as the combination of the PDF control and the PleaseWaitWindow is used, the problem occurs (and then durates for the rest of the application instance).

Once you enabled both checkboxes, and hit the "Run the test" button, you will notice that as soon as you hover the yellow bar at the top (InfoBarMessageControl, uses a popup to show error messages) or the combobox (uses a popup to show the items), the whole window except the popup will disappear.

How to "fix"

Put a breakpoint in the PleaseWaitHelper.Hide() method. You will see that the problem will not occur then, but that is of course not something we can do in a real-world scenario.

hoverproblem.zip (966.36 kb) [Downloads: 281]

kick it on DotNetKicks.com

Shows a reproducible bug in WPF when windows start disappearing as soon as you open a popup.

Tags:

C# Development | WPF

Comments (1) -

Jowen Mei
Jowen Mei Netherlands
12/15/2010 4:50:11 PM #

Thanks for the comprehensive example!

The bug doesn't occur when the Approved property has a default value... I'm curious whether or not Microsoft will fix this (soon), because of it's small impact and chance of occurrence.

Pingbacks and trackbacks (2)+

Comments are closed

About the Author

Geert van Horrik is an independent freelance software developer since January 1st, 2007. Since then he was been working on several projects from C++ to C# (WPF, Silverlight, ASP.NET, etc). Currently he loves to write his software using WPF (or Silverlight if WPF isn't an option).

Lately, Geert is spending a lot of time on Catel, a free open-source MVVM Framework for WPF and Silverlight. Actually, it's more than "just" an MVVM Framework, it's a complete application library!