LayoutInformation Classe

Definição

Define métodos que fornecem informação adicional sobre o estado de disposição de um elemento.

public ref class LayoutInformation abstract sealed
public static class LayoutInformation
type LayoutInformation = class
Public Class LayoutInformation
Herança
LayoutInformation

Exemplos

O exemplo seguinte demonstra como usar o GetLayoutSlot método para traduzir a caixa delimitadora de um FrameworkElement para um 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

Métodos

Name Description
GetLayoutClip(FrameworkElement)

Devolve a Geometry que representa a região visível de um elemento.

GetLayoutExceptionElement(Dispatcher)

Retornos que UIElement estavam a ser processados pelo motor de layout no momento de uma exceção não tratada.

GetLayoutSlot(FrameworkElement)

Devolve a Rect que representa a partição layout reservada para um elemento filho.

Aplica-se a