Hey everyone,
I am currently working on a WPF application using MVVM and I am stuck trying to bind a ComboBox to a list of items. I have an ObservableCollection in my ViewModel…, and the ComboBox is supposed to display it. However, it shows up empty in the UI.
Here’s the setup:
ViewModel has a public ObservableCollection Items
ComboBox’s ItemsSource is bound to Items
I am using DataContext properly (checked with a TextBlock binding)
What could be going wrong: ?? Do I need to use INotifyPropertyChanged even for the ObservableCollection: ?? Also, is it better to use Binding in XAML directly or set it in code-behind for such cases: ??
Any guidance or example snippets would be highly appreciated !! power bi course in delhi
Thanks in advance,
With Regards,
Daniel