Can't Data Bind to Dictionary<int, String>
Its as simple as the subject suggests... Here's my XAML
<Window.Resources>
<ObjectDataProvider x:Key="dataObject" ObjectInstance="{x:Static local:Window1.MyDictionary}"/>
</Window.Resources>
<Grid>
<ListBox ItemsSource="{Binding Source={StaticResource dataObject}}" />
</Grid>
MyDictionary is a public static property.
I can bind to a Dictionary<String, String> but not a Dictionary<int, String>. I get the following exception:
'System.Windows.Data.BindingExpression' value cannot be assigned to property 'ItemsSource' of object 'System.Windows.Controls.ListBox'. The given key was not present in the dictionary. Error at object 'System.Windows.Data.Binding' in markup file 'BindingTest;component/window1.xaml' Line 23 Position 13.
Help much appreciated
Niall

