Click here to Skip to main content
15,900,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In MVVM, what is the actual use of a Modal. I am using SQL as my database.

How will the Modal classes help me in anyway in my project. I read many examples and since I am a beginner here in MVVM, I couldn't get the idea behind.

Can some one explain it in a simpler way so that a newbie can get the idea of the actual use of Modal classes in WPF MVVM project using SQL as the database.



Thanks in advance.

Rahul
Posted

1 solution

Model classes act as the placeholder for your data.
The viewmodel populates these models.
Whenever, there are changes to the model, the viewmodel notifies the UI that it needs to be refreshed due to change in data.
 
Share this answer
 
Comments
Rahul Krishnan R 23-Apr-13 2:16am    
why dont the view modal directly communicates with the data? why does it need a placeholder modal for the data.
How is it helpful in a project?
Abhinav S 23-Apr-13 2:25am    
It could but then you are coupling data directly with the view model.
If you need to add another property, you will need to change the viewmodel.
That becomes messier.
Rahul Krishnan R 23-Apr-13 2:35am    
So, when compared to normal windows form programming, WPF with MVVM pattern require more coding for each forms created.
Model classes are extra classes other than the data from the database. Please correct me if I am wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900