Share via


LayoutInformation Klasse

Definition

Definiert Methoden, die zusätzliche Informationen zum Layoutzustand eines Elements bereitstellen.

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

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie die GetLayoutSlot Methode zum Übersetzen des Begrenzungsfelds einer in ein FrameworkElement .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

Methoden

GetLayoutClip(FrameworkElement)

Gibt eine Geometry zurück, die den sichtbaren Bereich eines Elements darstellt.

GetLayoutExceptionElement(Dispatcher)

Gibt ein UIElement zurück, das im Moment einer nicht behandelten Ausnahme von der Layout-Engine verarbeitet wurde.

GetLayoutSlot(FrameworkElement)

Gibt ein Rect zurück, das die für ein untergeordnetes Element reservierte Layoutpartition darstellt.

Gilt für