Click here to Skip to main content
15,888,590 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Pete O'Hanlon21-Jul-11 23:27
mvePete O'Hanlon21-Jul-11 23:27 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
SledgeHammer0122-Jul-11 6:45
SledgeHammer0122-Jul-11 6:45 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Pete O'Hanlon22-Jul-11 9:59
mvePete O'Hanlon22-Jul-11 9:59 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
SledgeHammer0122-Jul-11 10:11
SledgeHammer0122-Jul-11 10:11 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Pete O'Hanlon22-Jul-11 20:44
mvePete O'Hanlon22-Jul-11 20:44 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
_Maxxx_21-Jul-11 13:55
professional_Maxxx_21-Jul-11 13:55 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
BubingaMan25-Jul-11 1:46
BubingaMan25-Jul-11 1:46 
AnswerRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
RobCroll20-Jul-11 1:53
RobCroll20-Jul-11 1:53 
I guess people are relucent to publish low-brow MVVM examples in fear of getting shot down in flames.

The way I do it (using Entity Framwork) is the ViewModel provides a SaveCommand which the View binds to. After all, it should be up to the user to determine if the data is saved. So when the user clicks the Save button or other events occur, the command is fired and a method can handle the logic to persist the changes back to model.

In EF it's a one liner myContext.SaveChanges();

In your situation it sounds like you'll need to do a bit more leg work. But the stategy should still work. You need to catch the event in the ViewModel using a command.
"You get that on the big jobs."

AnswerRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
_Maxxx_21-Jul-11 14:06
professional_Maxxx_21-Jul-11 14:06 
QuestionDynamically changing themes from DLL at run-time Pin
Prasoon Chaudhary19-Jul-11 1:20
Prasoon Chaudhary19-Jul-11 1:20 
AnswerRe: Dynamically changing themes from DLL at run-time Pin
Varsha Ramnani20-Jul-11 21:23
professionalVarsha Ramnani20-Jul-11 21:23 
GeneralRe: Dynamically changing themes from DLL at run-time Pin
Prasoon Chaudhary20-Jul-11 22:42
Prasoon Chaudhary20-Jul-11 22:42 
QuestionFind an empty element in a Silverlight Grid Pin
Neo1010119-Jul-11 0:31
Neo1010119-Jul-11 0:31 
QuestionRe: Find an empty element in a Silverlight Grid Pin
Mark Salsbery19-Jul-11 12:35
Mark Salsbery19-Jul-11 12:35 
QuestionEntity Framework - Sorting Relationproperties Pin
Nicolai Schrade18-Jul-11 22:52
Nicolai Schrade18-Jul-11 22:52 
QuestionPerformance stymied by UIElement_CreateAutomationPeer Pin
Lee Reid16-Jul-11 14:01
Lee Reid16-Jul-11 14:01 
AnswerRe: Performance stymied by UIElement_CreateAutomationPeer [modified] Pin
SledgeHammer0118-Jul-11 10:20
SledgeHammer0118-Jul-11 10:20 
GeneralRe: Performance stymied by UIElement_CreateAutomationPeer Pin
Lee Reid18-Jul-11 16:40
Lee Reid18-Jul-11 16:40 
Questionwpf time picker control in vb.net Pin
prachi_sathep16-Jul-11 0:30
prachi_sathep16-Jul-11 0:30 
AnswerRe: wpf time picker control in vb.net Pin
Kim Breugelmans18-Jul-11 22:07
Kim Breugelmans18-Jul-11 22:07 
AnswerRe: wpf time picker control in vb.net Pin
Oludayo Alli16-Aug-11 2:29
Oludayo Alli16-Aug-11 2:29 
QuestionHow to enable wpf controls through data binding on a selected item from a combo box Pin
Member 297299215-Jul-11 4:20
Member 297299215-Jul-11 4:20 
AnswerRe: How to enable wpf controls through data binding on a selected item from a combo box [modified] Pin
Mark Salsbery15-Jul-11 6:11
Mark Salsbery15-Jul-11 6:11 
QuestionGame algorithm problem Pin
Neo1010115-Jul-11 4:05
Neo1010115-Jul-11 4:05 
AnswerRe: Game algorithm problem Pin
Mark Salsbery15-Jul-11 6:41
Mark Salsbery15-Jul-11 6:41 

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.