LayoutInformation Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Defines methods that provide additional information about the layout of an element.
Assembly: System.Windows (in System.Windows.dll)
The LayoutInformation type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | GetLayoutClip | Returns the visible region of the specified element. |
![]() ![]() | GetLayoutExceptionElement | Returns the element that was being processed by the layout system at the moment of an unhandled exception. |
![]() ![]() | GetLayoutSlot | Returns the layout slot, or bounding box, that contains the specified element. |
The LayoutInformation class provides the GetLayoutSlot, GetLayoutClip, and GetLayoutExceptionElement methods to help you understand and debug the layout behavior of your Windows Phone application.
GetLayoutSlot and GetLayoutClip return information about an element's bounding box and visible region. GetLayoutExceptionElement helps you determine where an exception is coming from during layout.
The following example shows how to use GetLayoutSlot and draw the bounding box for the Rectangle.
<StackPanel x:Name="sp1" Grid.Row="0" Background="LightBlue" Height="100" Width="200" HorizontalAlignment="Left" VerticalAlignment="Top" > <Rectangle x:Name="rect1" Fill="Blue" Width="100" Height="50" ></Rectangle> </StackPanel> <Button Content="Get Layout Slot" Grid.Row="1" Width="150" Height="50" Click="Button_Click" HorizontalAlignment="Left"/>

