Popup.PlacementTarget Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the element relative to which the Popup is positioned when it opens.
public:
property System::Windows::UIElement ^ PlacementTarget { System::Windows::UIElement ^ get(); void set(System::Windows::UIElement ^ value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.UIElement PlacementTarget { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.PlacementTarget : System.Windows.UIElement with get, set
Public Property PlacementTarget As UIElement
Property Value
The UIElement that is the logical parent of the Popup control. The default is null
.
- Attributes
Examples
The following example creates a Popup that is the child of a Canvas, and sets PlacementTarget to ellipse1
, so the popup is relative to the Ellipse.
<Canvas Margin="5" Background="Red" Width="200" Height="150" >
<Ellipse Name="ellipse1"
Canvas.Top="60" Canvas.Left="50"
Height="85" Width="60"
Fill="Black"/>
<Popup IsOpen="True" PlacementTarget="{Binding ElementName=ellipse1}">
<TextBlock Background="LightBlue" FontSize="18">This is a Popup</TextBlock>
</Popup>
</Canvas>
Remarks
You can position a popup by setting the PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, and VerticalOffset properties. For more information, see Popup Placement Behavior.
Dependency Property Information
Identifier field | PlacementTargetProperty |
Metadata properties set to true |
None |
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기