PopupButton.PopupClosed called before popup is actually closed

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 3 years ago by John Dunn
Version: 21.1.1
Platform: .NET 5.0
Environment: Windows 10 (64-bit)
Avatar

I'm showing a dialog when the popup is closed. The callback is called before the popup actually closes so my dialog box shows up behind the popup. Here's a screen shot - the green box is part of the popup and I am showing the MessageBox in PopupClosed.

Screenshot-2021-06-03-154625

Comments (2)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

We raise the PopupButton.PopupClosed event right in the property changed handler for the IsPopupOpen property.  I believe the Popup.IsOpen binding in the PopupButton's Template hasn't been dispatched by WPF yet (it would be DataBind dispatcher priority) at the time the event is raised.

If you do a Dispatcher.BeginInvoke call to show your MessageBox with DataBind priority from that event handler, it should work around the issue for now.

We updated our code to raise the PopupClosed event in a Dispatcher.BeginInvoke on our end with DataBind priority.  That should fix it for the next maintenance release.

[Modified 3 years ago]


Actipro Software Support

Posted 3 years ago by John Dunn
Avatar

Invoking the dialog did fix the issue in my application. Thanks.

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.