Class Popup
- Namespace
- Tudormobile.Wpf.Behaviors
- Assembly
- Tudormobile.WpfControls.dll
Adds a 'Popup' (Menu, Popup, or arbitrary content) to existing framework elements. Frequently used to add 'drop-down' menus and other content to controls such as Buttons, Images, and text.
The popup content can be a ContextMenu, Popup Control, or any content that can be hosted in a Popup control. A glyph in the form of a down arrow (or right-facing arrow) is overlayed, which makes this implementation mostly compatible with any control template and theme (Original, Fluent, Dark, Light, etc.). You may need to adjust things like button padding, or place your control in a frame to achieve the desired visuals, but the glyph is designed to work in many environemnts without having to define custome templates. As such, this behavior does not contain any visuals that can be modified.
public static class Popup
- Inheritance
-
Popup
- Inherited Members
Methods
GetPopupContent(DependencyObject)
Gets the content associated with the specified DependencyObject for a popup.
public static object GetPopupContent(DependencyObject obj)
Parameters
objDependencyObjectThe DependencyObject from which to retrieve the popup content.
Returns
- object
The content object associated with the specified DependencyObject. Returns null if no content is set.
SetPopupContent(DependencyObject, object)
Sets the content to be displayed in the popup associated with the specified dependency object.
public static void SetPopupContent(DependencyObject obj, object value)
Parameters
objDependencyObjectThe DependencyObject to which the popup content is associated. Cannot be null.
valueobjectThe content to display in the popup. This can be any object, such as a string, a UI element, or a data model.