The example does not set the PlacementTarget property on the Popup. The following example creates a Popup that is the child of a Canvas. If there is no PlacementTarget value and no parent, there is no target object, and the Popup is positioned relative to the screen. If PlacementTarget is not set, and the Popup has a parent, the parent is the target object. If the PlacementTarget property is set, it specifies the target object. The target object is the element that the Popup is associated with. These terms provide a convenient way to refer to various aspects of the Popup and the control that it is associated with. The following terms are useful in understanding how the PlacementTarget, Placement, PlacementRectangle, HorizontalOffset, and VerticalOffset properties relate to each other and the Popup: The previous image demonstrates right-handedness alignment, which places the popup to the left.ĭefinitions of Terms: The Anatomy of a Popup This simple example demonstrates how to set the PlacementTarget and Placement properties, but by using the PlacementRectangle, HorizontalOffset, and VerticalOffset properties, you have even more control over where the Popup is positioned.ĭepending on your Windows settings related to handedness, the popup may be left or right-aligned when shown on the top or bottom. The following illustration shows the image and the Popup controls All of the Popup controls have the PlacementTarget property set to image1, but each Popup has a different value for the placement property. The following example creates four Popup controls that are relative to a UIElement-in this case, an image. The placement of a Popup can be relative to a UIElement or to the entire screen. The ToolTip and ContextMenu classes also define these five properties and behave similarly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |