In 2012, we discovered a bug that could crash the application. Daniel L. Taylor had clearly explained:
[quote]I can confirm that. MouseDown is (naturally) being called multiple times in response to multiple clicks. But if MouseDown includes code to close the target page/control then subsequent calls from rapid clicks can crash hard. WE should detect that the page is closed server side and not attempt subsequent MouseDown dispatches, but if MouseDown occurs fast enough this doesn’t happen.
I uploaded a possible work around to the following URL:
See if it works for you or not. I can easily reproduce the crash using your project, but I cannot make this modified version crash. The modified version uses CriticalSections to serialize MouseDown calls; a property check to avoid creating multiple new pages (a less obvious problem with the original code); and delays closing the old page until the Shown event for the new (keeps old page around until no more MouseDowns can be dispatched).
I hope it works in your testing as well so that at least you have workaround until Real can fix this bug.
Is the problem still present?
Since then, I use the workaround of Daniel, but I fear that it causes memory leaks.