EF ComboBox not displaying SelectedItem Binding

前端 未结 2 1617
孤街浪徒
孤街浪徒 2021-01-06 05:37

I am using Entity Framework and Caliburn.Micro to implement an MVVM application.

Basically, I have set up AuthorModel and BookModel in a one to many relationship - a

2条回答
  •  生来不讨喜
    2021-01-06 06:22

    Yes it is. Because the author in ItemsSource is referencing to a different object although the content is the same as the one that is bind to SelectedItem.

    I don't know much about EF, I guess you can use the same context for the two entities. Or override the equals (and gethashcode) of the Author class to compare the content then return true if the same.

提交回复
热议问题