I am porting an old WinForms application to WPF and using the MVVM pattern. I have not written any code using this pattern previously. So I am confused and have a fairly basic questsion
In the Old app, I had a MainWindow and many tabs. The tabs all used objects that were defined in the MainWindow. So the functionality of each tab could be applied to these "global" objects and all was good. One tab provided functionality that did a transform
on an object. Another provided analysis on the current state of the same object and so on.
Now, with MVVM, I am using a similar UI model - MainWindow with many tabs where each tab has it's own viewModel and view. (don't want to change the UI on the users). My question is - where do I put the "global" objects? My model contains the classes definition
for these objects. But where is the instantiation done? in which class?
Am I to create a global model? one that represents the app at runtime? If so, how does each view/viewModel know to load the right instance of the "global" object so that it can then wrap appropriate parts in ObservableCollections etc?
Am I making sense or should I just get some shut eye tonight and RTFM tomorrow
View Complete Post