tags:

views:

1473

answers:

2

I found some items regarding this questions on SO, but they do not satisfy me. They talk about INotifyProperyChanged, but that does not help in my case.

I have a Combobox. For the ItemsSource, I use a MultiBinding and a Converter to create an ICollectionView. The ICollectionView gets bound to the ItemsSource.

On the GotFocus-event, this binding needs to be refreshed, so the converter gets fired again.

How can I do this?

A: 

If you can access your ICollectionView in your code behind, you might want to try the Refresh method...

Hope this helps..

Arcturus
That does not help.That refreshes the ICollectionView, but the ICollectionView needs to be recreated by the Converter. So the converter needs to be refired.
Natrium
+4  A: 

Ok, a collegue helped me out.

This is the solution:

private void theComboBox_OnGotFocus(object sender, RoutedEventArgs e)
{
 ComboBox theComboBox = sender as ComboBox;

 if (theComboBox != null)
 {
  MultiBindingExpression binding = BindingOperations.GetMultiBindingExpression(theComboBox, ComboBox.ItemsSourceProperty);
  if (binding != null)
  {
   binding.UpdateTarget();
  }
 }
}
Natrium