다음을 통해 공유


LayoutInformation.GetLayoutSlot(FrameworkElement) 메서드

정의

자식 요소에 예약된 레이아웃 파티션을 나타내는 Rect를 반환합니다.

public:
 static System::Windows::Rect GetLayoutSlot(System::Windows::FrameworkElement ^ element);
public static System.Windows.Rect GetLayoutSlot (System.Windows.FrameworkElement element);
static member GetLayoutSlot : System.Windows.FrameworkElement -> System.Windows.Rect
Public Shared Function GetLayoutSlot (element As FrameworkElement) As Rect

매개 변수

element
FrameworkElement

레이아웃 슬롯을 가져올 FrameworkElement입니다.

반환

Rect

요소의 레이아웃 슬롯을 나타내는 Rect입니다.

예제

다음 예제에 사용 하는 방법을 보여 줍니다.는 GetLayoutSlot 의 경계 상자를 변환 하는 메서드를 FrameworkElementGeometryDrawing.

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

적용 대상