Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

338
Views
Cómo vincular los valores del origen del elemento (matriz de cadenas) a una etiqueta en un ListView

Tengo una matriz de cadenas que configuré como fuente de elemento de ListView. El ListView ahora tiene la misma cantidad de filas que la matriz tiene elementos. Sin embargo, no sé cómo establecer el enlace. Sé que para un diccionario configuré 'Valor' que funciona bien.

 string[] array = {"1","2","3"}; MyListView.ItemsSource = array;

XAML

 <ListView x:Name="MyListView"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Label Text="{Binding Value, StringFormat='The value : {0:N}'}" /> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Si desea vincular directamente al valor del objeto en sí, use el "." sintaxis para la ruta

 <Label Text="{Binding .}" />
over 4 years ago · Santiago Trujillo Report

0

Para vincular directamente al objeto, debe usar:

 <Label Text="{Binding}" />

Esta es la abreviatura de:

 <Label Text="{Binding Path=.}" />
over 4 years ago · Santiago Trujillo Report

0

En (MVVM/Code-Behind/C#), tuve un problema similar con una matriz de cadenas y lo resolví con el siguiente código.

 someLabel.SetBinding(Label.TextProperty, new Binding("."));

Espero que esto ayude a alguien =)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!