UWP / WinRT: Detect when a popup is about to be closed
问题 How can I detect when a popup is about to be closed? The Popup class does not have a Closing event in UWP, unlike in WPF where such an event exists. I need this in order to persist the state of the Popup because the layout can be modified by the user. 回答1: As you already know, there is no Closing event. You might get lucky by registering to IsOpen property change (if IsLightDismissEnabled property is set to true...) this.popup.RegisterPropertyChangedCallback(Popup.IsOpenProperty, (d, e) => {