Click here to Skip to main content
15,913,245 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Closable Tabs Pin
jgalak23-Jul-11 14:48
jgalak23-Jul-11 14:48 
GeneralRe: Closable Tabs Pin
SledgeHammer0123-Jul-11 15:01
SledgeHammer0123-Jul-11 15:01 
GeneralRe: Closable Tabs Pin
Mark Salsbery23-Jul-11 15:36
Mark Salsbery23-Jul-11 15:36 
GeneralRe: Closable Tabs Pin
jgalak24-Jul-11 9:21
jgalak24-Jul-11 9:21 
GeneralRe: Closable Tabs Pin
Mark Salsbery24-Jul-11 9:26
Mark Salsbery24-Jul-11 9:26 
GeneralRe: Closable Tabs Pin
jgalak24-Jul-11 9:36
jgalak24-Jul-11 9:36 
GeneralRe: Closable Tabs Pin
Mark Salsbery24-Jul-11 9:41
Mark Salsbery24-Jul-11 9:41 
GeneralRe: Closable Tabs Pin
SledgeHammer0124-Jul-11 9:54
SledgeHammer0124-Jul-11 9:54 
GeneralRe: Closable Tabs Pin
Mark Salsbery24-Jul-11 11:17
Mark Salsbery24-Jul-11 11:17 
GeneralRe: Closable Tabs Pin
SledgeHammer0124-Jul-11 9:52
SledgeHammer0124-Jul-11 9:52 
GeneralRe: Closable Tabs Pin
jgalak27-Jul-11 14:31
jgalak27-Jul-11 14:31 
QuestionSimple and good way to Windows application development using C# + WPF + MVVC + prism 4 ? Pin
Manjeet patel22-Jul-11 3:15
Manjeet patel22-Jul-11 3:15 
AnswerRe: Simple and good way to Windows application development using C# + WPF + MVVC + prism 4 ? Pin
Ian Shlasko22-Jul-11 3:37
Ian Shlasko22-Jul-11 3:37 
GeneralRe: Simple and good way to Windows application development using C# + WPF + MVVC + prism 4 ? Pin
Manjeet patel22-Jul-11 3:48
Manjeet patel22-Jul-11 3:48 
AnswerRe: Simple and good way to Windows application development using C# + WPF + MVVC + prism 4 ? Pin
Abhinav S22-Jul-11 4:05
Abhinav S22-Jul-11 4:05 
AnswerRe: Simple and good way to Windows application development using C# + WPF + MVVC + prism 4 ? Pin
Richard MacCutchan22-Jul-11 4:25
mveRichard MacCutchan22-Jul-11 4:25 
QuestionScrolling in nested Listbox WPF Pin
Phantom1322-Jul-11 0:29
Phantom1322-Jul-11 0:29 
AnswerRe: Scrolling in nested Listbox WPF Pin
teejayem30-Jul-11 12:44
teejayem30-Jul-11 12:44 
QuestionSplash Screen in WPF Browser APP Pin
vonb21-Jul-11 1:21
vonb21-Jul-11 1:21 
AnswerRe: Splash Screen in WPF Browser APP Pin
vonb21-Jul-11 4:33
vonb21-Jul-11 4:33 
QuestionStyle.TargetType = Interface || abstract class Pin
ezazazel19-Jul-11 22:44
ezazazel19-Jul-11 22:44 
AnswerRe: Style.TargetType = Interface || abstract class Pin
Kunal Chowdhury «IN»20-Jul-11 0:23
professionalKunal Chowdhury «IN»20-Jul-11 0:23 
QuestionMVVM: Transfering data from ViewModel to Model, when and how ? [modified] Pin
Jean-Louis Leroy19-Jul-11 1:38
Jean-Louis Leroy19-Jul-11 1:38 
Hello,

There's a lot of talk on the net about the View-ViewModel interaction but little about the ViewModel-Model interaction.

I have a Report that has (as a composition) a collection of Parameters. So I have a ReportViewModel that has a collection of ParameterViewModels, a ReportView bound to the ReportViewModel, and the ReportView in turn carries an ItemsControl-full of UserControls bound to the ParameterViewModels. The ReportViewModel's constructor gets passed the Report object and passes the Parameter objects in turn to the sub-viewmodels.

The Views and ViewModels interact nicely, the ViewModels "load" themselves from the underlying Models. More precisely, they keep a reference to the Model and synthesize whatever information the View needs.

Now for what puzzles me: when/how does the data flow back from ViewModel to Model ? When/how does the user's gesturing finally impacts the Model ?

I see that there are at least two possibilities...

1/ Live-update the Model whenever the ViewModel changes. Whenever we want to run operations on the updated Report, there's nothing extra to do.

2/ Implement an explicit "Apply" method in both ViewModels - obviosuly ReportViewModel.Apply will call ParameterViewModel.Apply. Whenever we need an up-to-date Report, first call Apply then save it somewhere, or print it, whatever.

What's your take on this ?

Jean-Louis
modified on Tuesday, July 19, 2011 7:49 AM

AnswerRe: MVVM: Transfering data from ViewModel to View, when and how ? Pin
Pete O'Hanlon19-Jul-11 1:45
mvePete O'Hanlon19-Jul-11 1:45 
AnswerRe: MVVM: Transfering data from ViewModel to Model, when and how ? Pin
Abhinav S20-Jul-11 0:42
Abhinav S20-Jul-11 0:42 

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.