Lire en anglais

Partager via


LayoutInformation Classe

Définition

Définit des méthodes qui fournissent des informations supplémentaires sur l'état de disposition d'un élément.

C#
public static class LayoutInformation
Héritage
LayoutInformation

Exemples

L’exemple suivant montre comment utiliser la GetLayoutSlot méthode pour traduire le cadre englobant d’un FrameworkElement en .GeometryDrawing

C#
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();
}

Méthodes

GetLayoutClip(FrameworkElement)

Retourne un Geometry qui représente la région visible d'un élément.

GetLayoutExceptionElement(Dispatcher)

Retourne un UIElement traité par le moteur de disposition au moment d'une exception non gérée.

GetLayoutSlot(FrameworkElement)

Retourne un Rect qui représente la partition de disposition réservée pour un élément enfant.

S’applique à

Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7