LayoutInformation Classe

Definizione

Definisce i metodi che forniscono informazioni aggiuntive sullo stato di layout di un elemento.

public ref class LayoutInformation abstract sealed
public static class LayoutInformation
type LayoutInformation = class
Public Class LayoutInformation
Ereditarietà
LayoutInformation

Esempio

Nell'esempio seguente viene illustrato come utilizzare il GetLayoutSlot metodo per convertire il rettangolo di selezione di un FrameworkElement oggetto in un oggetto 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

Metodi

Nome Descrizione
GetLayoutClip(FrameworkElement)

Restituisce un oggetto Geometry che rappresenta l'area visibile di un elemento.

GetLayoutExceptionElement(Dispatcher)

Restituisce un oggetto UIElement che è stato elaborato dal motore di layout al momento di un'eccezione non gestita.

GetLayoutSlot(FrameworkElement)

Restituisce un oggetto Rect che rappresenta la partizione di layout riservata a un elemento figlio.

Si applica a