I’ve come across an issue where in a certain set of circumstances I can’t get a ComboBox to display its SelectedValue. Specifically, it’s where I have a ViewModel based on ViewModelDetailBase and an associated View based on a Page (as opposed
to a ChildWindow). There’s no problem with the ComboBox loading its values but try as I might I can’t get it to display the item that it is bound to. Binding seems to be okay: I have used a Test Converter to check that the bound value is being
passed in to SelectedValue and the value from the model is being passed in.
Initially of course I thought it was something to do with my project but as a test I’ve taken your SimpleMvvm-Part3-After solution and added a test ViewModel (ViewModelDetailBase based on Product) and a View and set things up to display a ComboBox
bound to Model.CategoryID. I get exactly the same result, ie the ComboBox doesn’t display a value.
Can you think of anything I might be doing wrong? Does the binding syntax change if a ChildWindow is not being used? Is there some other code needed to make things work? One big difference of course is that using a Page means that the model can’t be
passed in via the ctor and I’m either newing an entity in the ctor or getting the entity to edit via the NavigationHelper technique. I’ve spent literally hours trying to work through this so any nugget would be very welcome. If a look at my altered
SimpleMvvm-Part3-After solution would help I can easily zip it up and send it over.
Cheers - Graham