Silverlight ComboBox binding with Dictionary.
private void Page_Loaded(object sender, RoutedEventArgs e) {
Dictionary dict = new Dictionary();
dict.Add(1, “India”);
dict.Add(2, “USA”);
dict.Add(3, “FINLAND”);
cboCountry.ItemsSource = myDic;
}
private void cboCountry_SelectionChanged(object sender, SelectionChangedEventArgs e) {
KeyValuePair curItem = (KeyValuePair) cboCountry.SelectedItem;
MessageBox.Show(curItem.Key.ToString());
}