共用方式為


LayoutInformation 類別

定義

定義用來提供關於項目配置狀態之其他資訊的方法。

public ref class LayoutInformation abstract sealed
public static class LayoutInformation
type LayoutInformation = class
Public Class LayoutInformation
繼承
LayoutInformation

範例

下列範例示範如何使用 GetLayoutSlot 方法將 的 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

方法

GetLayoutClip(FrameworkElement)

傳回表示項目可見區域的 Geometry

GetLayoutExceptionElement(Dispatcher)

傳回 UIElement,其已在發生未處理例外狀況時由配置引擎加以處理。

GetLayoutSlot(FrameworkElement)

傳回 Rect,其表示為子項目所保留的配置分割。

適用於