Hi everyone,
I'm very new to WPF, and in the course of migrating my app to comply with MVVM, I seem to have introduced some behavior I don't understand at all.
I have a combobox bound to an ObservableCollection<String> that is programmatically being opened from my ViewModel. It's collection is updated dynamically as the user types into a text field. The IsDropdownOpen property is bound to a bool in my ViewModel,
which implements INotifyPropertyChanged.
If the dropdown is open, and the user changes focus to another application, the dropdown is never made visible again. When the condition required to show the dropdown is met, the property is still being updated, the NotifyPropertyChanged method is called, the
PropertyChanged event handler is a valid object and is called with the correct property name, but the UI element is not made visible.
Are there any hints you can provide for how to debug this behavior further?
Here's the XAML I'm using for the combobox. I've tried making the IsDropDownOpen binding two-way, but that doesn't help either:
<ComboBox DataContext="{Binding SearchBoxVm}" Name="cmboSearchField" Height="0.667" VerticalAlignment="Top" IsEditable="True" StaysOpenOnEdit="True"
PreviewKeyUp="cmboSearchField_OnKeyUp" PreviewMouseLeftButtonUp="cmboSearchField_OnPreviewMouseLeftButtonUp" Background="White" ItemsSource="{Binding SearchTopics}" IsDropDownOpen="{Binding SuggestionsVisible, UpdateSourceTrigger=PropertyChanged}"
Margin="50.997,15.333,120.44,0" RenderTransformOrigin="0.5,0.5" Grid.Row="1">