I created a behavior and in it I renewed the binding in a case of pressing the keys:
public class KeysChangedBehavior : Behavior<ComboBox>
{
protected override void OnAttached()
{
this.AssociatedObject.AddHandler(ComboBox.KeyDownEvent,
new RoutedEventHandler(this.OnKeysChanged));
this.AssociatedObject.AddHandler(ComboBox.KeyUpEvent,
new RoutedEventHandler(this.OnKeysChanged));
}
protected void OnKeysChanged(object sender, RoutedEventArgs e)
{
BindingExpression _binding = ((ComboBox)sender).GetBindingExpression(ComboBox.SelectedItemProperty);
if (_binding != null)
_binding.UpdateSource();
}
}
Here the combobox:
<ComboBox ItemsSource="{Binding StrList}" SelectedItem="{Binding Str,UpdateSourceTrigger=LostFocus}" Height="50" Width="200">
<i:Interaction.Behaviors>
<KeysChangedBehavior/>
</i:Interaction.Behaviors>
</ComboBox>