I'm having a torrid time with WPF and getting notification on bindings.
I've got a DLL (Called Population) that contains a class based on a dictionary that I am storing a custom class in:
public class WTRunRepository : Dictionary<int,WTRun>
{
}
I have other methods in the class that add or update the dictionary as needed, and these are referenced fine in the viewmodel that is using this dll.
I want to see what is in the dictionary dynamically in my view, so in my viewmodel I've added
public Population Pop = new Population();
public WTRunRepository Repository
{
get
{
return Pop.RunRepository;
}
}
I've then tried binding to it with my view:
<ListBox ItemsSource="{Binding Repository}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Key}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
No joy. Still being relatively new to WPF I feel like pulling my hair out. Which bit is wrong? I've tried changing the Dictionary definition to implement a convoluted CollectionChanged Interface, but still nothing happens.
Help...