What is the best practice for accessing Model using MVVM pattern

Posted by Dzenand on Stack Overflow See other posts from Stack Overflow or by Dzenand
Published on 2010-02-24T13:52:53Z Indexed on 2010/03/29 4:23 UTC
Read the original article Hit count: 224

Filed under:
|
|
|

I have a database that communicates with webservices with my Model (own thread) and exposes Data Objects. My UI application consists of different Views and ViewModels and Custom Controls. I'm using ServiceProvider (IServiceProvider) to access the Model and route the events to the UI thread. Communication between the ViewModels is handeled by a Messenger.

Is this way to go?

I was also wondering what is the best way to strucutre the DataObjects

At the moment i have the DataObjects that have a hierarchy structure but does not support INotifyProperty though the children list are of type of ObservableCollection. I have no possiblity to implement notifypropertychange on the properties.

I was wondering the best way of making them MVVM friendly. Implementing a partial class and adding all the properties or commands that are necessary or wrapping all the DataObjects and keep the Model list and MVVM list in sync.

All thoughts and ideas are appreciated.

© Stack Overflow or respective owner

Related posts about c#

Related posts about mvvm