I\'ve read a number of posts on binding Dictionary to WPF ListView and ListBox but I can\'t get equivalent code to work in WinRT.
I've come up with a workaround, that involves generating your own Key Value pairs dynamically.
If you've specialized Dictionary, just add this:
public IEnumerable> Collection
{
get {
foreach (var v in this)
{
MyPair p = new MyPair() { Key = v.Key, Value = v.Value };
yield return p;
}
}
}
and define your Pair type:
public class MyPair
{
public K Key { get; set; }
public V Value { get; set; }
}
Also, be careful that you create a new object each time. Some items walk across the object, and store the return, which can lead to everything looking like the last item, if you try to reuse the MyPair like I originally did.