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

WPF

 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Jean-Louis Leroy21-Jul-11 23:20
Jean-Louis Leroy21-Jul-11 23:20 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Pete O'Hanlon21-Jul-11 23:29
mvePete O'Hanlon21-Jul-11 23:29 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Jean-Louis Leroy21-Jul-11 23:51
Jean-Louis Leroy21-Jul-11 23:51 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Pete O'Hanlon22-Jul-11 0:02
mvePete O'Hanlon22-Jul-11 0:02 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
SledgeHammer0122-Jul-11 6:39
SledgeHammer0122-Jul-11 6:39 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Sacha Barber22-Jul-11 11:27
Sacha Barber22-Jul-11 11:27 
GeneralRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
SledgeHammer0122-Jul-11 6:28
SledgeHammer0122-Jul-11 6:28 
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 
Errm. Are you 100% sure about this design approach as an absolute? How do you handle validation in this case or support for IEditableObject? The reality is, a hybrid approach will generally be necessary.

In the case where you want to simply forward a property on, then your approach is fine, but where you need to validate something before it can be committed, then you should use an intermediary value. Similarly, if changes can be rolled back then you should support an intermediary value. That's the approach to use.

Take the case you mentioned - where you have a huge amount of text in a model, the VM would generally do some clever processing so that only a subset of the text was kept bound to the view, virtualized in other words, and the model would be updated with the subset. In this way, the VM simply presents a snapshot of some of the text at that point in time.

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


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 
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 

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.