Click here to Skip to main content
15,512,747 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM Master-Details project Pin
Geysser12-Mar-12 0:28
Geysser12-Mar-12 0:28 
GeneralRe: MVVM Master-Details project Pin
Mycroft Holmes12-Mar-12 2:07
professionalMycroft Holmes12-Mar-12 2:07 
GeneralRe: MVVM Master-Details project Pin
Geysser12-Mar-12 3:43
Geysser12-Mar-12 3:43 
GeneralRe: MVVM Master-Details project Pin
Pete O'Hanlon12-Mar-12 2:23
mvaPete O'Hanlon12-Mar-12 2:23 
Questionmerge different pieces of a wmv files Pin
bruno.picardi10-Mar-12 10:00
bruno.picardi10-Mar-12 10:00 
QuestionUserControl Template Pin
michaelgr110-Mar-12 1:52
michaelgr110-Mar-12 1:52 
AnswerRe: UserControl Template Pin
Abhinav S10-Mar-12 20:18
Abhinav S10-Mar-12 20:18 
QuestionNext MVVM Discussion Pin
Kevin Marois9-Mar-12 7:39
professionalKevin Marois9-Mar-12 7:39 
A coworker and I were discussion the design for a WPF app. It's being built using MVVM.

We have a series of user control that are going to be added to the main window at runtime. The user controls to be added are determined by the data coming back from the repository. So for model A, add user control A, type B, add user control B, and so on. The main window's VM would call into the repository, get back a collection of models, and then for each mode, determine which user control to add to the grid in the main window.

He was adamant that the VM "should not know anything about views because this breaks the MVVM pattern." He insisted that you can do all this through data templates. he also suggested that I read up on MVVM and I'll see this is true. Now I'v read lots of MVVM artiicles and Josh Smith's book, and blogs galore. I have never hear this notion that the VM can't know about views (add views at runtime).

If you're going to add controls at runtime, then the main window VM is going to need to know about the views. I am working on another WPF app that has a toolbox and design surface (canvas). The user will be able to drag & drop controls off the toolbox onto the design surface. I don't see how this could be templated, and I'm pretty sure that there's no way to do this without the main window VM adding the controls to the main window view.

I'm open to opinions. Documentation would be good.
Everything makes sense in someone's mind

AnswerRe: Next MVVM Discussion Pin
Mycroft Holmes9-Mar-12 13:37
professionalMycroft Holmes9-Mar-12 13:37 
GeneralRe: Next MVVM Discussion Pin
Abhinav S10-Mar-12 20:16
Abhinav S10-Mar-12 20:16 
GeneralRe: Next MVVM Discussion Pin
Mycroft Holmes10-Mar-12 22:36
professionalMycroft Holmes10-Mar-12 22:36 
GeneralRe: Next MVVM Discussion Pin
Kevin Marois11-Mar-12 14:54
professionalKevin Marois11-Mar-12 14:54 
GeneralRe: Next MVVM Discussion Pin
Mycroft Holmes11-Mar-12 15:20
professionalMycroft Holmes11-Mar-12 15:20 
AnswerRe: Next MVVM Discussion Pin
Abhinav S10-Mar-12 20:12
Abhinav S10-Mar-12 20:12 
QuestionHistory of MVVM Pin
Kevin Marois8-Mar-12 11:19
professionalKevin Marois8-Mar-12 11:19 
AnswerRe: History of MVVM Pin
Pete O'Hanlon8-Mar-12 12:17
mvaPete O'Hanlon8-Mar-12 12:17 
GeneralRe: History of MVVM Pin
Colin Eberhardt9-Mar-12 0:04
Colin Eberhardt9-Mar-12 0:04 
GeneralRe: History of MVVM Pin
Pete O'Hanlon9-Mar-12 0:30
mvaPete O'Hanlon9-Mar-12 0:30 
GeneralRe: History of MVVM Pin
Colin Eberhardt9-Mar-12 0:38
Colin Eberhardt9-Mar-12 0:38 
GeneralRe: History of MVVM Pin
Pete O'Hanlon9-Mar-12 0:44
mvaPete O'Hanlon9-Mar-12 0:44 
GeneralRe: History of MVVM Pin
Colin Eberhardt9-Mar-12 0:50
Colin Eberhardt9-Mar-12 0:50 
GeneralRe: History of MVVM Pin
Pete O'Hanlon9-Mar-12 1:04
mvaPete O'Hanlon9-Mar-12 1:04 
GeneralRe: History of MVVM Pin
SledgeHammer019-Mar-12 5:40
SledgeHammer019-Mar-12 5:40 
GeneralRe: History of MVVM Pin
Pete O'Hanlon9-Mar-12 10:23
mvaPete O'Hanlon9-Mar-12 10:23 
AnswerRe: History of MVVM Pin
Abhinav S8-Mar-12 20:52
Abhinav S8-Mar-12 20:52 

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.