Hello, I'm trying to learn MVVM, and I'm not sure about some of the details, mainly in the part where the data (data) models need to communicate with the VM (ViewModel).
So, I have a cool person, he has many properties (with Raiseproperty (INotifyPropertyChanged)). Now, how can I connect this class to the virtual machine, I will create a new class and name it ViewModelPerson, but basically I want a list of faces, since displaying only one person is useless, the list will be assembled from a database (SQLite) with Dapper. Now, where do I need to create an observable list, in the viewmodel or in (data)? I think in ViewModel, since I need to associate this with the view, but where do I insert the database information from it into the ViewModel ObservableCollection? I put it in a constructor such as ViewModelPersonsList Constructor, which has a request to collect all the people from SQlite DB and paste it into the list ???
I hope you understand where I do not understand the MVVM model, if something is unclear, just ask and I will try to better explain my question.
Maxim
source
share