PopupButton.PopupClosed called before popup is actually closed

WPF Studio, Themes, and Shared Library for WPF Forum

The latest build of this product (v21.1.1) was released 3 months ago, which was before this thread was created.
Posted 12 days ago by John Dunn
Version: 21.1.1
Platform: .NET 5.0
Environment: Windows 10 (64-bit)

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.


Comments (2)

Posted 11 days ago by Actipro Software Support - Cleveland, OH, USA

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 11 days ago]

Actipro Software Support

Posted 11 days ago by John Dunn

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

Add Comment

Please log in to a validated account to post comments.