LayoutInformation Clase

Definición

Define métodos que proporcionan información adicional sobre el estado del diseño de un elemento.

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

Ejemplos

En el ejemplo siguiente se muestra cómo usar el GetLayoutSlot método para traducir el rectángulo delimitador de en 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

Métodos

GetLayoutClip(FrameworkElement)

Devuelve un Geometry que representa el área visible de un elemento.

GetLayoutExceptionElement(Dispatcher)

Devuelve un UIElement que el motor de diseño estaba procesando en el momento en el que se ha producido una excepción no controlada.

GetLayoutSlot(FrameworkElement)

Devuelve un Rect que representa la partición de diseño que se reserva para un elemento secundario.

Se aplica a