WPF How to bind to a specific element in the Collection
Posted
by PaN1C_Showt1Me
on Stack Overflow
See other posts from Stack Overflow
or by PaN1C_Showt1Me
Published on 2010-05-18T06:25:32Z
Indexed on
2010/05/18
6:30 UTC
Read the original article
Hit count: 166
Hi,
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
© Stack Overflow or respective owner