Export (0) Print
Expand All
Expand Minimize

PlacementMode Enumeration

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

Namespace:  System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

[LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)]
public enum PlacementMode
<object property="enumerationMemberName" .../>

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 right edge with the left 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 Popup 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. For more information, see Popup Placement Behavior.

The following example creates four Popup controls that are relative to an image. Each Popup has a different value for the placement property.

<Canvas Width="200" Height="150">
  <Image Name="image1"
         Canvas.Left="75" 
         Source="Water_lilies.jpg" Height="200" Width="200"/>
  <Popup IsOpen="True" PlacementTarget="{Binding ElementName=image1}"
         Placement="Bottom">
    <TextBlock FontSize="14" Background="LightGreen">Placement=Bottom</TextBlock>

  </Popup>
  <Popup IsOpen="True" PlacementTarget="{Binding ElementName=image1}"
         Placement="Top">
    <TextBlock FontSize="14" Background="LightGreen">Placement=Top</TextBlock>

  </Popup>
  <Popup IsOpen="True" PlacementTarget="{Binding ElementName=image1}"
         Placement="Left">
    <TextBlock FontSize="14" Background="LightGreen">Placement=Left</TextBlock>

  </Popup>
  <Popup IsOpen="True" PlacementTarget="{Binding ElementName=image1}"
         Placement="Right">
    <TextBlock FontSize="14" Background="LightGreen">Placement=Right</TextBlock>

  </Popup>
</Canvas>

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft