WPF Popup - when to disable, how to keep origin control in relative position?;)
1 answer
- Events
Popup.Opened
andPopup.Closed
fire when the popup is shown and hidden. - I would install
Popup.PlacementRectangle
based on the sourceControl
, which can be obtained with a methodControl.PointToScreen
like this:
Point location = originControl.PointToScreen(new Point(0, 0));
You will need to listen for an event UIElement.LayoutUpdated
(and possibly some other events) to determine when the position of the control has changed.
0
a source to share