Popup.Placement Property
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Namespace: System.Windows.Controls.Primitives
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
<object Placement="PlacementMode" .../>
Property Value
Type: System.Windows.Controls.Primitives.PlacementModeA 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.
You can position a popup by setting the PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, and VerticalOffsetProperty 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.
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>
Windows 8 Consumer Preview, Windows Server 8 Beta, Windows 7, Windows Server 2008 SP2, 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.