Click here to Skip to main content
15,891,372 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Silverlight 2: Code: 4001. Category: ImageError. Message: AG_E_NETWORK_ERROR Pin
SBJ22-May-09 7:41
SBJ22-May-09 7:41 
GeneralRe: Silverlight 2: Code: 4001. Category: ImageError. Message: AG_E_NETWORK_ERROR Pin
Mark Salsbery22-May-09 8:07
Mark Salsbery22-May-09 8:07 
GeneralRe: Silverlight 2: Code: 4001. Category: ImageError. Message: AG_E_NETWORK_ERROR Pin
SBJ22-May-09 10:32
SBJ22-May-09 10:32 
GeneralRe: Silverlight 2: Code: 4001. Category: ImageError. Message: AG_E_NETWORK_ERROR Pin
Mark Salsbery22-May-09 10:39
Mark Salsbery22-May-09 10:39 
QuestionM-V-VM implementation question Pin
ml_black21-May-09 9:48
ml_black21-May-09 9:48 
AnswerRe: M-V-VM implementation question Pin
Pete O'Hanlon21-May-09 10:33
mvePete O'Hanlon21-May-09 10:33 
GeneralRe: M-V-VM implementation question Pin
ml_black22-May-09 2:32
ml_black22-May-09 2:32 
GeneralRe: M-V-VM implementation question Pin
Pete O'Hanlon22-May-09 3:15
mvePete O'Hanlon22-May-09 3:15 
ml_black wrote:
Where do I convert the PersonViewModel back to a Person? I'm thinking within the PersonViewModel.


Correct. In the example link I showed you, the validation in the PersonViewModel is responsible for updating the Person model with the relevant values. What I would tend to do is have a Save command on the View model that called the Save method on your View - yes, it seems like a lot of extra overhead, but it really helps to save your sanity.

Try to think of this as comparable to a n-tiered system, where the UI is the View, the business layer is your ViewModel and the DAL is the model. You wouldn't want the business layer to have to know how to save data to the database, that's the job of the DAL. Similarly, you wouldn't want the DAL to have to be aware of the business rules that surround what is or is not a valid piece of data - that's the job of the BL.

It's this clear separation of concerns that makes MVVM so attractive.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: M-V-VM implementation question Pin
ml_black22-May-09 4:14
ml_black22-May-09 4:14 
Questionprogramming html in wpf using c# Pin
ramakrishnamakkena21-May-09 2:40
ramakrishnamakkena21-May-09 2:40 
AnswerRe: programming html in wpf using c# Pin
Pete O'Hanlon21-May-09 4:32
mvePete O'Hanlon21-May-09 4:32 
QuestionListViewItem promblem Pin
mildred-frontfree21-May-09 0:57
mildred-frontfree21-May-09 0:57 
AnswerRe: ListViewItem promblem Pin
ABitSmart21-May-09 5:13
ABitSmart21-May-09 5:13 
GeneralRe: ListViewItem promblem Pin
mildred-frontfree21-May-09 18:14
mildred-frontfree21-May-09 18:14 
GeneralRe: ListViewItem promblem Pin
ABitSmart21-May-09 18:26
ABitSmart21-May-09 18:26 
AnswerRe: ListViewItem promblem Pin
Niladri_Biswas13-Jun-09 3:17
Niladri_Biswas13-Jun-09 3:17 
GeneralRe: ListViewItem promblem Pin
mildred-frontfree16-Jun-09 14:56
mildred-frontfree16-Jun-09 14:56 
GeneralRe: ListViewItem promblem Pin
Niladri_Biswas17-Jun-09 21:13
Niladri_Biswas17-Jun-09 21:13 
QuestionHelp getting values from combobox and comparing them to items in stackpanel Pin
Member 422055221-May-09 0:45
Member 422055221-May-09 0:45 
QuestionScrollViewer - How To Determine End of Scroll [SOLVED] Pin
#realJSOP21-May-09 0:32
mve#realJSOP21-May-09 0:32 
AnswerRe: ScrollViewer - How To Determine End of Scroll Pin
Pete O'Hanlon22-May-09 0:52
mvePete O'Hanlon22-May-09 0:52 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP22-May-09 8:54
mve#realJSOP22-May-09 8:54 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP1-Jun-09 11:09
mve#realJSOP1-Jun-09 11:09 
QuestionNo get device context Pin
krishnan.s20-May-09 15:26
krishnan.s20-May-09 15:26 
AnswerRe: No get device context Pin
Mark Salsbery20-May-09 15:49
Mark Salsbery20-May-09 15:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.