LayoutInformation Kelas

Definisi

Menentukan metode yang menyediakan informasi tambahan tentang status tata letak elemen.

public ref class LayoutInformation abstract sealed
public static class LayoutInformation
type LayoutInformation = class
Public Class LayoutInformation
Warisan
LayoutInformation

Contoh

Contoh berikut menunjukkan cara menggunakan GetLayoutSlot metode untuk menerjemahkan kotak FrameworkElement pembatas ke dalam GeometryDrawing.

private void getLayoutSlot1(object sender, System.Windows.RoutedEventArgs e)
{
    RectangleGeometry myRectangleGeometry = new RectangleGeometry();
    myRectangleGeometry.Rect = LayoutInformation.GetLayoutSlot(txt1);
    Path myPath = new Path();
    myPath.Data = myRectangleGeometry;
    myPath.Stroke = Brushes.LightGoldenrodYellow;
    myPath.StrokeThickness = 5;
    Grid.SetColumn(myPath, 0);
    Grid.SetRow(myPath, 0);
    myGrid.Children.Add(myPath);
    txt2.Text = "LayoutSlot is equal to " + LayoutInformation.GetLayoutSlot(txt1).ToString();
}
Private Sub getLayoutSlot1(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim myRectangleGeometry As New RectangleGeometry
    myRectangleGeometry.Rect = LayoutInformation.GetLayoutSlot(txt1)
    Dim myPath As New Path
    myPath.Data = myRectangleGeometry
    myPath.Stroke = Brushes.LightGoldenrodYellow
    myPath.StrokeThickness = 5
    Grid.SetColumn(myPath, 0)
    Grid.SetRow(myPath, 0)
    myGrid.Children.Add(myPath)
    txt2.Text = "LayoutSlot is equal to " + LayoutInformation.GetLayoutSlot(txt1).ToString()
End Sub

Metode

Nama Deskripsi
GetLayoutClip(FrameworkElement)

Mengembalikan Geometry yang mewakili wilayah elemen yang terlihat.

GetLayoutExceptionElement(Dispatcher)

Mengembalikan yang sedang diproses UIElement oleh mesin tata letak pada saat pengecualian yang tidak tertangani.

GetLayoutSlot(FrameworkElement)

Mengembalikan Rect yang mewakili partisi tata letak yang dicadangkan untuk elemen turunan.

Berlaku untuk