Share via

Popup.Placement Property


Gets or sets the orientation of the Popup control when the control opens, and specifies the behavior of the Popup control when it overlaps screen boundaries.

 property System::Windows::Controls::Primitives::PlacementMode Placement { System::Windows::Controls::Primitives::PlacementMode get(); void set(System::Windows::Controls::Primitives::PlacementMode value); };
public System.Windows.Controls.Primitives.PlacementMode Placement { get; set; }
member this.Placement : System.Windows.Controls.Primitives.PlacementMode with get, set
Public Property Placement As PlacementMode

Property Value

A PlacementMode enumeration value that determines the orientation of the Popup control when the control opens, and that specifies how the control interacts with screen boundaries. The default is Bottom.



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"
         Source="Water_lilies.jpg" Height="200" Width="200"/>
  <Popup IsOpen="True" PlacementTarget="{Binding ElementName=image1}"
    <TextBlock FontSize="14" Background="LightGreen">Placement=Bottom</TextBlock>

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

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

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



You can position a popup by setting the PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, and VerticalOffset properties. For more information, see Popup Placement Behavior.

If the MenuDropAlignment property is true, setting Placement to Left or Right reverses the position of the Popup; a Popup with Placement set to Left aligns its left edge with the right edge of PlacementTarget and a Popup with Placement set to Right aligns its right edge with the left edge of PlacementTarget.

Dependency Property Information

Identifier field PlacementProperty
Metadata properties set to true None

Applies to

See also