Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WCF, Silverlight, MVVM

Posted on 2011-03-06
2
Medium Priority
?
947 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 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

662 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