✅ How to bind an object observable property with mvvm community toolkit in wpf
I'm trying to migrate a wpf app to use the mvvm toolkit. I have a viewmodel and model setup that looks like this:
Now if I try to update a property of "Book" like in
I guess ObservableProperty only works when assigning a new value directly to the tagged property. Because my
How can I make it so that updating the inner properties of Book also updates the Book property itself?
Or maybe I shouldn't use the Book object directly and I should just expose the Book properties directly in the viewmodel like this below?
Now if I try to update a property of "Book" like in
ChangeTitle or AddChapter methods, the view doesn't update. I guess ObservableProperty only works when assigning a new value directly to the tagged property. Because my
LoadBook method can definitely update the view. I'm binding my view like this:How can I make it so that updating the inner properties of Book also updates the Book property itself?
Or maybe I shouldn't use the Book object directly and I should just expose the Book properties directly in the viewmodel like this below?