Click here to Skip to main content
15,914,016 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 8:05
SledgeHammer0125-Jan-12 8:05 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon25-Jan-12 8:15
mvePete O'Hanlon25-Jan-12 8:15 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 13:31
SledgeHammer0125-Jan-12 13:31 
GeneralRe: MVVM Blues... Pin
BillWoodruff29-Jan-12 13:21
professionalBillWoodruff29-Jan-12 13:21 
GeneralRe: MVVM Blues... Pin
Tom Delany26-Jan-12 10:40
Tom Delany26-Jan-12 10:40 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon26-Jan-12 10:44
mvePete O'Hanlon26-Jan-12 10:44 
GeneralRe: MVVM Blues... Pin
Tom Delany26-Jan-12 10:53
Tom Delany26-Jan-12 10:53 
GeneralRe: MVVM Blues... Pin
SledgeHammer0126-Jan-12 12:24
SledgeHammer0126-Jan-12 12:24 
Personally, I prefer using the ViewModelLocator method vs. DataTemplates. Some people are the other way around.

I think the ViewModelLocator method is a lot cleaner and makes more sense. You load up a view and it should know how to do its own thing. Creating the VM first seems backwards to me.

IMO, you shouldn't be creating VMs by hand. You should leave that to the view locator and DI.

Also, the ViewModelLocator is 1 line in XAML vs. the DataTemplate method with is 3 lines of XAML + C# code to create the VM and set the DataContext.
GeneralRe: MVVM Blues... Pin
Tom Delany26-Jan-12 14:25
Tom Delany26-Jan-12 14:25 
GeneralRe: MVVM Blues... Pin
Dean Oliver24-Jan-12 19:05
Dean Oliver24-Jan-12 19:05 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 13:37
SledgeHammer0125-Jan-12 13:37 
AnswerRe: MVVM Blues... Pin
Ravi Bhavnani25-Jan-12 12:25
professionalRavi Bhavnani25-Jan-12 12:25 
GeneralRe: MVVM Blues... Pin
Kevin Marois29-Jan-12 9:23
professionalKevin Marois29-Jan-12 9:23 
AnswerRe: MVVM Blues... Pin
Dean Oliver29-Jan-12 18:50
Dean Oliver29-Jan-12 18:50 
GeneralRe: MVVM Blues... Pin
Kevin Marois30-Jan-12 7:49
professionalKevin Marois30-Jan-12 7:49 
GeneralRe: MVVM Blues... Pin
Dean Oliver30-Jan-12 18:02
Dean Oliver30-Jan-12 18:02 
GeneralRe: MVVM Blues... Pin
Kevin Marois30-Jan-12 8:03
professionalKevin Marois30-Jan-12 8:03 
GeneralRe: MVVM Blues... Pin
Dean Oliver30-Jan-12 18:03
Dean Oliver30-Jan-12 18:03 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon31-Jan-12 0:56
mvePete O'Hanlon31-Jan-12 0:56 
QuestionSilverlight App versus Silverlight Busines App Pin
Kevin Marois24-Jan-12 8:09
professionalKevin Marois24-Jan-12 8:09 
AnswerRe: Silverlight App versus Silverlight Busines App Pin
Abhinav S25-Jan-12 0:45
Abhinav S25-Jan-12 0:45 
Questiondynamicaly open elements from a xaml resource Pin
Giorgi Nistor23-Jan-12 22:37
Giorgi Nistor23-Jan-12 22:37 
AnswerRe: dynamicaly open elements from a xaml resource Pin
Giorgi Nistor23-Jan-12 23:50
Giorgi Nistor23-Jan-12 23:50 
GeneralRe: dynamicaly open elements from a xaml resource Pin
Giorgi Nistor25-Jan-12 4:07
Giorgi Nistor25-Jan-12 4:07 
QuestionMVVM architecture Pin
mi_n22-Jan-12 21:18
mi_n22-Jan-12 21:18 

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.