2 simpl questions.
Given a WPF popup...
What is a good way to hide it again when it is used like a submenu? WHich event is proper?
WHat is the way to keep it's position stable relative to the origin control?
THanks in advance ;)
2 simpl questions.
Given a WPF popup...
What is a good way to hide it again when it is used like a submenu? WHich event is proper?
WHat is the way to keep it's position stable relative to the origin control?
THanks in advance ;)
Popup.Opened
and Popup.Closed
events are fired when the popup is shown and hidden.Popup.PlacementRectangle
based on the Control
origin, which can be obtained using the Control.PointToScreen
method like so:Point location = originControl.PointToScreen(new Point(0, 0));
You will need to listen to the UIElement.LayoutUpdated
event (and probably some other events, too) to determine when the control position has changed.