Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WCF, Silverlight, MVVM

Posted on 2011-03-06
2
Medium Priority
?
951 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
2 Comments
 
LVL 27

Accepted Solution

by:
MikeToole earned 1500 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

Independent Software Vendors: 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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Integration Management Part 2
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 21 hours left to enroll

916 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