Solved

WCF, Silverlight, MVVM

Posted on 2011-03-06
2
938 Views
Last Modified: 2013-03-13
Hi Experts,

I am going through MVVM pattern. I am bit confused in the "Model" part.

Mine is a silverlight data driven project, using WCF, C# and SQL Server.

If we want to implement, where the Model goes?

For example,
1. I am having a customer object, so, defined one customer.cs class as a datacontract and data member in WCF

2. Having customer.xaml (This resides in View Folder of silverlight application)
3. Having a viewmodel folder inside silverlight project, and having customerviewmodel.cs file which creating proxy to the server service(WCF) and access the required methods

4. Having another customer.cs class file inside silverlight project to duplicate the WCF customer.cs datacontract file (or which ever property is required for customer view) and implemented INotify property changed.

Now, my doubt is which is Model as per MVVM?

Customer.cs with Inotify in siliverlight project

Or

Customer.cs datacontract in WCF?

As per MVVM, Model talking abt the property file in server or property file in silvelrightproject?

Thankyou so much.
0
Comment
Question by:RameshLathu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
MikeToole earned 500 total points
ID: 35057261
The ViewModel should be the only thing that the View is aware of. That is where INotifyPropertyChanged would be used to prompt the View to pick-up changed values.
The Model class is the interface to the stored data.
In the simplest case the ViewModel properties can be simple wrappers of the properties provided by the Model class.

Thus:

View <==> ViewModel <==> Model <==> Repository
0
 

Author Closing Comment

by:RameshLathu
ID: 35102188
Thankyou,

I was thinking Model will have the properties with INotify

and

ViewModel class will have all the interaction with the service like WCF
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I do Unit Testing with Session ? 1 41
parse string in c# 5 41
"The resource cannot be found" 1 44
c# ftp code 3 56
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question