0

I want to make a binding to a specific element in the Collection. But I cannot figure out how to write the Binding. This is the code:

public class MySource
{
 ..
 public string SomeProp;
 public ICollection<T> MyCollection;
 ..
}

this.DataContext = new MySource();

<TextBox Text={Binding SomeProp} />

<TextBox Text={Binding FIRST_ELEMENT_OF_THE_MyCollection} />
<TextBox Text={Binding SECOND_ELEMENT_OF_THE_MyCollection} />
<!--Ignore other elements-->

Try to replace those binding strings, please

Thank you

theSpyCry
  • 11,793
  • 28
  • 94
  • 149

1 Answers1

1
<TextBox Text="{Binding MyCollection[0]}" /> 
<TextBox Text="{Binding MyCollection[1]}" />
Amsakanna
  • 11,291
  • 8
  • 45
  • 56