Hi, I have a class
public class Foo
{
public List<string> list1 { get; set;}
public List<string> list2 { get; set; }
public string url;
}
and a ListView with two columns
<ListView Name="listview" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="list1"
DisplayMemberBinding="{Binding Path=list1}" />
<GridViewColumn Header="list2"
DisplayMemberBinding="{Binding Path=list2}" />
</GridView>
</ListView.View>
</ListView>
How i can to bind instance of Foo class to ListView?
Here i set a DataContext
listview.DataContext = new Foo()
{
list1 = new[] { "dsfasd", "asdfasdf", "asdf", "asdfsd" }.ToList(),
list2 = new[] { "dsfasd", "asdfasdf", "asdf", "asdfasd" }.ToList()
};
But it's not work.