Click here to Skip to main content
15,923,689 members
Home / Discussions / WPF
   

WPF

 
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 
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 
I take option 2 over option 1 'almost always'

I treat my Model object as an object whose job it is to go get the data for the client. Once delivered its job is done, so I don't keep a reference to the Model in my ViewModel (again, 'usually' )

So I rarely Update model objects - as they're going to be persisted back in the DB - I create new objects when required and send them back to be stored.

I must confess to not quite understanding your scenario here - how your report and Parameter objects interract - but assuming you are maintaining the report and/or parameter objects, then I would normally have some sort of Apply method as per your option2.

if you do it this way, then at least you have the option of using the Apply method as frequently or infrequently as you want to - on a timer, every time a parameter type is changed - whatever.

But I don't think there's a 'right' way of doing it - and it depends on your exact requirements.

One of the downsides of option 1 is the ability to revert changes quickly... As you're maintaining a reference to the Model and want to cancel changes, you can just re-set your VM from the Model and you're back!
MVVM# - See how I did MVVM my way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011

.\\axxx
(That's an 'M')

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 
AnswerRe: Game algorithm problem Pin
Abhinav S15-Jul-11 6:51
Abhinav S15-Jul-11 6:51 

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.