Short and simple question. In Winforms you can bind a dataview to a combobox or some other control by simply:
combobox.DataSource = dataview
combobox.DisplayMember = "Something"
In WPF I’ve generally done databinding using an ObservableCollection and edits to the xaml. Is there a way to quickly do it, like the above?
Edit:
This seems to be the simplest/quickest thing I can come up with, anything inherently wrong with it?
combobox.ItemSource = dataview
combobox.DisplayMemberPath = "Something"
You can set binding programmatically, although, per my understanding of the MVVM pattern, the best practice is to set binding in the View (xaml) not the ViewModel or View code-behind.
How to set binding programmatically:
With this, when your dataview is updated, the updates will be shown in your ComboBox.