
For bitmap effects to appear on the content of a Popup, you must set the bitmap effect directly on its content. The content of a Popup does not inherit bitmap effects, such as DropShadowBitmapEffect, that you directly set on the Popup control or on any other element in the parent window. To create a transparent Popup, set the AllowsTransparency property to true. By default, the Popup content window is opaque. The Opacity property for a Popup control has no effect on its content. You can also apply animations like Storyboard to the Popup control. For Popup animations to work correctly, you must set the AllowsTransparency property to true. You can turn on these animations by setting the PopupAnimation property to a PopupAnimation enumeration value. The Popup control has built-in support for the animations that are typically associated with behaviors like fade-in and slide-in. The Opened and Closed events are raised when the Popup content window is open or closed. The Popup loses mouse capture and the window closes when a mouse event occurs outside the Popup window. When you set this property to false, the Popup content window has mouse capture. However, you can change the default behavior by setting the StaysOpen property to false. By default, Popup stays open until the IsOpen property is set to false. For example, you can set open and close behavior, animation, opacity and bitmap effects, and Popup size and position.Ī Popup control displays its content when the IsOpen property is set to true. The Popup control provides functionality that enables you to customize its behavior and appearance. For more information, see Expander Overview. If you want to create a control that displays a header with a collapsible area that displays content, use the Expander control. If you want to create a selection control that has a drop-down list box that can be shown or hidden, use the ComboBox control.Įxpander. For more information, see ContextMenu Overview.ĬomboBox. If you want to create a context menu for an element, use the ContextMenu control. For more information, see ToolTip Overview.ĬontextMenu. If you want to create a tooltip for an element, use the ToolTip and ToolTipService classes. The following controls implement the Popup control for specific uses: You can build Popup controls into other controls. The content of the Popup is displayed in a separate window that floats over the application window near the related ToggleButton control. Because a ToggleButton can have only one child element, this example places the text for the ToggleButton and the Popup controls in a StackPanel.
#POPUP WINDOW EXAMPLES HOW TO#
The following example shows how to define a Popup control that is the child element of a ToggleButton control. For more information, see ToolTip Overview.

If you want a Popup to automatically open, use the ToolTip or ToolTipService class. A Popup does not automatically open when the mouse pointer moves over its parent object.
