RowDefinitionCollection.IndexOf(RowDefinition) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Devolve a posição de índice de uma dada RowDefinition dentro de um 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
Parâmetros
- value
- RowDefinition
A RowDefinition posição de índice desejada.
Devoluções
O índice de value se encontrado na coleção; caso contrário, -1.
Implementações
Exemplos
O exemplo seguinte demonstra como usar o IndexOf método para determinar a posição de índice de a RowDefinition dentro de um 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
Para ver a amostra completa, veja Como: Manipular Colunas e Linhas Usando ColeçõesDefiniçõesColomnas e ColeçõesDefiniçõesLinhas.