RowDefinitionCollection.IndexOf(RowDefinition) 메서드

정의

RowDefinition 내에 지정된 RowDefinitionCollection의 인덱스 위치를 반환합니다.

public:
 virtual int IndexOf(System::Windows::Controls::RowDefinition ^ value);
public int IndexOf (System.Windows.Controls.RowDefinition value);
abstract member IndexOf : System.Windows.Controls.RowDefinition -> int
override this.IndexOf : System.Windows.Controls.RowDefinition -> int
Public Function IndexOf (value As RowDefinition) As Integer

매개 변수

value
RowDefinition

인덱스 위치를 가져올 RowDefinition입니다.

반환

컬렉션에 value가 있으면 해당 값의 인덱스이고, 그렇지 않으면 -1입니다.

구현

예제

다음 예제에서는 사용 하는 방법에 설명 합니다 IndexOf 의 인덱스 위치를 결정 하는 방법을 RowDefinition 내에서 RowDefinitionCollection입니다.

private void insertRowAt(object sender, RoutedEventArgs e)
{
    rowDef1 = new RowDefinition();
    grid1.RowDefinitions.Insert(grid1.RowDefinitions.Count, rowDef1);
    tp1.Text = "RowDefinition added at index position " + grid1.RowDefinitions.IndexOf(rowDef1).ToString();
}
Private Sub insertRowAt(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim rowDef1 As New RowDefinition
    grid1.RowDefinitions.Insert(grid1.RowDefinitions.Count, rowDef1)
    tp1.Text = "RowDefinition added at index position " + grid1.RowDefinitions.IndexOf(rowDef1).ToString()
End Sub

전체 샘플을 보려면 방법: 조작할 열 및 행으로 사용 하 여 ColumnDefinitionsCollections 및 RowDefinitionsCollections합니다.

적용 대상

추가 정보