Popup.PlacementRectangle Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur persegi relatif Popup terhadap posisi kontrol saat terbuka.
public:
property System::Windows::Rect PlacementRectangle { System::Windows::Rect get(); void set(System::Windows::Rect value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Rect PlacementRectangle { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.PlacementRectangle : System.Windows.Rect with get, set
Public Property PlacementRectangle As Rect
Nilai Properti
Persegi panjang yang digunakan untuk memosisikan Popup kontrol. Defaultnya adalah null.
- Atribut
Contoh
Contoh berikut mengatur PlacementRectangle properti dari Popup. Properti X, , WidthY, dan Height masing-masing PlacementRectangle adalah 50, 50, 50, dan 100. Popup relatif terhadap batas PlacementRectangle properti. Perhatikan bahwa PlacementRectangle properti tidak membuat elemen yang terlihat dalam aplikasi; contoh membuat Rectangle dengan batas yang sama untuk mewakili PlacementRectangle.
<Canvas Width="200" Height="200" Background="Red">
<Rectangle Canvas.Top="50" Canvas.Left="50"
Width="50" Height="100"
Stroke="White" StrokeThickness="3"/>
<Popup IsOpen="True" PlacementRectangle="50,50,50,100">
<TextBlock FontSize="14" Background="Yellow"
Width="140" TextWrapping="Wrap">
This is a popup with a PlacementRectangle.
</TextBlock>
</Popup>
</Canvas>
Keterangan
Anda dapat memposisikan popup dengan mengatur properti PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, dan VerticalOffset. Untuk informasi selengkapnya, lihat Perilaku Penempatan Popup.
Informasi Properti Dependensi
| Item | Nilai |
|---|---|
| Bidang pengidentifikasi | PlacementRectangleProperty |
Properti metadata diatur ke true |
Tidak |