A simple WPF ListView:
<ListView Name="recordContainer" ItemsSource="{Binding Path=MyCollection}">
<GridView>
<GridViewColumn Width="260" Header="Name" DisplayMemberBinding="{Binding Path=Name}"/>
<GridViewColumn Width="100" Header="Value" DisplayMemberBinding="{Binding Path=Value}"/>
</GridView>
</ListView>
MyCollection is a property on my Page:
public ObservableCollection<MyData> MyCollection
{
get
{
return myCollection;
}
}
and this is my data object:
public class MyData
{
public string Name { get; set; }
public string Value { get; set; }
}
I fill up myCollection in the contructor of the page (before InitializeComponent) but the list is coming up empty!
I have the exact same configuration on other pages and it works fine - what am I missing?
Any help appreciated!