Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

PlacementMode Enumeration

Describes the placement of a where a Popup control appears on the screen.

Namespace: System.Windows.Controls.Primitives
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)] 
public enum PlacementMode
/** @attribute LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable) */ 
public enum PlacementMode
LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable) 
public enum PlacementMode
<object property="EnumerationValue" .../>
 Member nameDescription
AbsoluteA position of the Popup control relative to the upper-left corner of the screen and at an offset that is defined by the HorizontalOffset and VerticalOffset property values. If the screen edge obscures the Popup, the control then repositions itself to align with the edge. 
AbsolutePointA position of the Popup control relative to the upper-left corner of the screen and at an offset that is defined by the HorizontalOffset and VerticalOffset property values. If the screen edge obscures the Popup, the control extends in the opposite direction from the axis defined by the HorizontalOffset or VerticalOffset=. 
BottomA position of the Popup control where the control aligns its upper edge with the lower edge of the PlacementTarget and aligns its left edge with the left edge of the PlacementTarget. If the lower screen-edge obscures the Popup, the control repositions itself so that its lower edge aligns with the upper edge of the PlacementTarget. If the upper screen-edge obscures the Popup, the control then repositions itself so that its upper edge aligns with the upper screen-edge. 
CenterA position of the Popup control where it is centered over the PlacementTarget. If a screen edge obscures the Popup, the control repositions itself to align with the screen edge.  
CustomA position and repositioning behavior for the Popup control that is defined by the CustomPopupPlacementCallback delegate specified by the Popup.CustomPopupPlacementCallback property. 
LeftA Popup control that aligns its left edge with the right edge of the PlacementTarget and aligns its upper edge with the upper edge of the PlacementTarget. If the left screen-edge obscures the Popup, the control repositions itself so that its left edge aligns with the right edge of the PlacementTarget. If the right screen-edge obscures the Popup, the right edge of the control aligns with the right screen-edge. If the upper or lower screen-edge obscures the Popup, the control repositions itself to align with the obscuring screen edge. 
MouseA postion of the Popup control that aligns its upper edge with the lower edge of the bounding box of the mouse and aligns its left edge with the left edge of the bounding box of the mouse. If the lower screen-edge obscures the Popup, it repositions itself to align with the upper edge of the bounding box of the mouse. If the upper screen-edge obscures the Popup, the control repositions itself to align with the upper screen-edge.  
MousePointA position of the Popup control relative to the tip of the mouse cursor and at an offset that is defined by the HorizontalOffset and VerticalOffset property values. If a horizontal or vertical screen edge obscures the Popup, it opens in the opposite direction from the obscuring edge. If the opposite screen edge also obscures the Popup, it then aligns with the obscuring screen edge. 
RelativeA position of the Popup control relative to the upper-left corner of the PlacementTarget and at an offset that is defined by the HorizontalOffset and VerticalOffset property values. If the screen edge obscures the Popup, the control repositions itself to align with the screen edge. 
RelativePointA position of the Popup control relative to the upper-left corner of the PlacementTarget and at an offset that is defined by the HorizontalOffset and VerticalOffset property values. If a screen edge obscures the Popup, the Popup extends in the opposite direction from the direction from the axis defined by the HorizontalOffset or VerticalOffset. If the opposite screen edge also obscures the Popup, the control then aligns with this screen edge. 
RightA position of the Popup control that aligns its left edge with the right edge of the PlacementTarget and aligns its upper edge with the upper edge of the PlacementTarget. If the right screen-edge obscures the Popup, the control repositions itself so that its left edge aligns with the left edge of the PlacementTarget. If the left screen-edge obscures the Popup, the control repositions itself so that its left edge aligns with the left screen-edge. If the upper or lower screen-edge obscures the Popup, the control then repositions itself to align with the obscuring screen edge. 
TopA position of the Popup control that aligns its lower edge with the upper edge of the PlacementTarget and aligns its left edge with the left edge of the PlacementTarget. If the upper screen-edge obscures the Popup, the control repositions itself so that its upper edge aligns with the lower edge of the PlacementTarget. If the lower screen-edge obscures the Popup, the lower edge of the control aligns with the lower screen-edge. If the left or right screen-edge obscures the Popup, it then repositions itself to align with the obscuring screen. 

Use the members of this enumeration class to set the value of the Placement property of a Popup control. The Placement property value, together with the values of the PlacementTarget, PlacementRectangle, HorizontalOffset and VerticalOffsetproperties, determines where and how a Popup appears on the screen.

In addition to the unique placement rules defined for specific members of this enumeration class, the following placement rules apply to all the Popup controls:

  • A Popup whose height is greater than the screen height, repositions itself along the upper edge of the screen.

  • A Popup whose width is greater than the screen width, repositions itself along the left edge of the screen.

  • A Popup that covers more than 75 percent of the screen, reduces its width first and then its height to meet the maximum coverage limit of 75 percent.

This example shows how the PlacementMode enumeration values help you position a Popup or a tooltip control. Use the PlacementMode enumeration values to set the Popup.Placement, ToolTip.Placement, and ToolTipService.Placement properties.

NoteNote:

This topic discusses only one of the five properties that you use to position a Popup or tooltip control. Before you read this topic, read How to: Position a Popup or How to: Position a ToolTip. Use the information in this topic together with the information in those related topics.

The PlacementMode enumeration works together with other properties to position tooltips and Popup controls. Tooltips, which you create by using the ToolTip control or the ToolTipService, have the same positioning rules as the Popup control. Therefore, although the following examples specifically refer to the Popup control, they also generically apply to tooltips. For more information about all the properties that you use to position a Popup or tooltip, see the topics that are specified in the previous note. For more information about tooltips, see the ToolTip Overview.

The PlacementMode enumeration defines the possible values of the Placement property. Each PlacementMode enumeration defines a method of positioning the Popup window for a point or an element. The following illustration shows how a Popup or a tooltip is positioned. The Placement property in this example has a value of Bottom. This value positions the Popup below the point that is defined by the other properties.

Popup and tooltip placement properties


Popup placement diagram

The following illustrations and definitions show how the PlacementMode enumeration values help you place the Popup window and adjust its position when screen boundaries obscure its content.

The placement of a tooltip follows the same rules as the placement of a Popup window. Tooltip placement properties that are equivalent to the Popup placement properties exist on the ToolTip and ToolTipService classes. For more information, see How to: Position a ToolTip.

PlacementMode = Absolute

A position of the Popup control that is relative to the upper-left corner of the screen and offset by the HorizontalOffset and VerticalOffset properties.

Absolute Popup placement

If a screen edge hides all or part of the Popup, the control realigns with the obscuring edge.

Absolute Popup placement

PlacementMode = AbsolutePoint

A position of the Popup control that is relative to the upper-left corner of the screen and offset by the HorizontalOffset and VerticalOffset properties.

Absolute Popup placement

If a screen edge hides all or part of the Popup, the control opens in the opposite direction by starting at the point that is defined by the offset properties.

PlacementMode = Bottom

A position of the Popup control where the control aligns its upper edge with the lower edge of the PlacementTarget and aligns its left edge with the left edge of the PlacementTarget.

Bottom Popup placement

If the lower edge of the screen hides all or part of the Popup, the control realigns with the upper edge of the PlacementTarget. If the upper edge of the screen hides all or part of this new position, the control realigns with the lower edge of the screen. After these adjustments, if the control is still partially hidden by the upper edge of the screen, the control realigns with the upper edge of the screen.

Bottom Popup placement

If a vertical screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Bottom Popup placement

PlacementMode = Center

A position of the Popup control where the control centers itself over the PlacementTarget.

Center Popup placement

If a screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Center Popup placement

PlacementMode = Left

A Popup control that aligns its right edge with the left edge of the PlacementTarget and its upper edge with the upper edge of the PlacementTarget.

Left Popup placement

If a horizontal screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Left Popup placement

If a vertical screen edge hides all or part of the Popup, the control realigns on the opposite side of the PlacementTarget.

Left Popup placement

PlacementMode = Mouse

A position of the Popup control where it aligns its upper edge with the lower edge of the bounding box of the mouse, and it aligns its left edge with the left edge of the mouse bounding box.

Mouse Popup placement

If a horizontal screen edge hides all or part of the Popup, the control displays on the opposite side of the mouse bounding box.

Mouse Popup placement diagram

If a vertical screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Mouse Popup placement

PlacementMode = MousePoint

A position of the Popup control that aligns its upper edge with the lower edge of the mouse bounding box and its left edge with the left edge of the mouse bounding box.

Mouse Popup placement

If a screen edge hides all or part of the Popup, the control realigns on the opposite side of the mouse bounding box.

Mouse Popup placement diagram

MousePoint Popup placement

PlacementMode = Relative

A position of the Popup control that is relative to the upper-left corner of the PlacementTarget and at an offset that is defined by the HorizontalOffset and VerticalOffset property values.

Relative Popup placement

If a screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Relative Popup placement

Relative Popup placement diagram

Placement Mode = RelativePoint

A position of the Popup control that is relative to the upper-left corner of the PlacementTarget and at an offset that is defined by the HorizontalOffset and VerticalOffset property values.

Relative Popup placement

If a screen edge hides all or part of the Popup, the control opens in the opposite direction by starting at the point that is defined by the offset properties.

RelativePoint Popup placement RelativePoint Popup placement

PlacementMode = Right

A position of the Popup control that aligns its left edge with the right edge of the PlacementTarget and aligns its upper edge with the upper edge of the PlacementTarget.

Right Popup placement

If a vertical screen edge hides all or part of the Popup, the control displays on the opposite side of the PlacementTarget.

Right Popup placement

If the upper or lower screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Placement Mode = Top

A position of the Popup control that aligns its lower edge with the upper edge of the PlacementTarget and aligns its left edge with the left edge of the PlacementTarget.

If the upper edge of the screen hides all or part of the Popup, the control displays below the PlacementTarget. If the lower edge of the screen hides the Popup in the new position, the control realigns with the lower edge of the screen. If the control is still obscured by the upper screen edge in the third position, the control realigns with the upper screen edge.

Top Popup placement

If a vertical screen edge hides all or part of the Popup, the control realigns with the obscuring screen edge.

Top Popup placement

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.