Popup.PlacementTarget Właściwość

Definicja

Pobiera lub ustawia element względem elementu, który jest umieszczony po otwarciu Popup .

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

Wartość właściwości

UIElement

Jest UIElement to logiczny element nadrzędny kontrolki Popup . Wartość domyślna to null.

Atrybuty

Przykłady

Poniższy przykład tworzy obiekt , który jest elementem Popup podrzędnym Canvasobiektu , i ustawia PlacementTarget wartość ellipse1, więc wyskakujące okienko jest względne względem obiektu 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>

Uwagi

Wyskakujące okienko można ustawić, PlacementTargetustawiając właściwości , PlacementRectangle, Placement, HorizontalOffseti VerticalOffset . Aby uzyskać więcej informacji, zobacz Zachowanie umieszczania w oknie podręcznym.

Informacje dotyczące właściwości zależności

Pole identyfikatora PlacementTargetProperty
Właściwości metadanych ustawione na true Brak

Dotyczy

Zobacz też