You can use binding expressions:
private void ComboBox_Loaded(object sender, RoutedEventArgs e) { ((ComboBox)sender).GetBindingExpression(ComboBox.ItemsSourceProperty) .UpdateTarget(); }
But as Blindmeis noted , you can also activate change notifications, if your collection implements INotifyCollectionChanged (for example, implemented in ObservableCollection<T> ), it will be synchronized so you do not need to do anything.
HB Apr 15 '11 at 11:50 2011-04-15 11:50
source share