Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm writing an app (using a MVVM architecture) in which I have to collect customer's registration data. Part of that data is customer's address. I have a web service on our server which returns a list of US states and I'm expected to use this service. As I understand, MVVM requires (strongly encourages) 1-to-1 mapping of Model-ModelView-View. Additionally, I foresee having to obtain a list of states for another form in the same app. So the question is: what's the right way to implement this in MVVM?

What I have tried:

So far, I can't think of a way that would not violate the 1-to-1 rule. A high level example is appreciated.
Posted
Comments
[no name] 20-Oct-16 16:05pm    
Just use the same model. Code reuse trumps some arbitrary "rule" that no one will really care about anyway. There is no MVVM police.

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