Click here to Skip to main content
16,012,468 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: No experience, learning C# & WPF Pin
Jammer1-Apr-10 14:17
Jammer1-Apr-10 14:17 
GeneralRe: No experience, learning C# & WPF Pin
Pete O'Hanlon2-Apr-10 10:02
mvePete O'Hanlon2-Apr-10 10:02 
GeneralRe: No experience, learning C# & WPF Pin
Jammer12-Apr-10 10:52
Jammer12-Apr-10 10:52 
GeneralRe: No experience, learning C# & WPF Pin
Jammer1-Apr-10 14:09
Jammer1-Apr-10 14:09 
GeneralRe: No experience, learning C# & WPF Pin
tim.gent@gmail.com2-Apr-10 0:22
tim.gent@gmail.com2-Apr-10 0:22 
GeneralRe: No experience, learning C# & WPF Pin
Jammer2-Apr-10 6:06
Jammer2-Apr-10 6:06 
QuestionMVVM Pin
DoctorMick30-Mar-10 4:30
DoctorMick30-Mar-10 4:30 
AnswerRe: MVVM Pin
Abhinav S30-Mar-10 4:42
Abhinav S30-Mar-10 4:42 
DoctorMick wrote:
Obviously, my ViewModel should know nothing about the view so I can't do it there, can I?


There could be a few ways to handle this.

An easy approach would be to use the navigational framework. But this does not provide the decoupling you are talking about.

You cannot let your viewmodel know about the new view that you would want to launch, but you can let it know about the viewmodel for it. Create an instance of the view using the viewmodel. All this is based on the assumption that you are using the "viewmodel first" approach while implementing MVVM.

If you want to decouple a little more than that, use a common controller class that handles all view / view model creations - this way all your view model knows about is this common controller class - nothing else.

A fourth approach could be to use the EventAggregator pattern implemented by Microsoft Prism. Prism provides very high level of decoupling, but then there is a learning curve attached to the features it provides.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest.
Honestly. It's the honest ones you want to watch out for...


QuestionCustom user control binding Pin
Joe Rozario29-Mar-10 18:42
Joe Rozario29-Mar-10 18:42 
AnswerRe: Custom user control binding [modified] Pin
Parwej Ahamad30-Mar-10 3:46
professionalParwej Ahamad30-Mar-10 3:46 
GeneralRe: Custom user control binding Pin
Joe Rozario31-Mar-10 17:58
Joe Rozario31-Mar-10 17:58 
GeneralRe: Custom user control binding Pin
Parwej Ahamad31-Mar-10 18:16
professionalParwej Ahamad31-Mar-10 18:16 
GeneralRe: Custom user control binding Pin
Parwej Ahamad31-Mar-10 18:23
professionalParwej Ahamad31-Mar-10 18:23 
GeneralRe: Custom user control binding Pin
Parwej Ahamad31-Mar-10 18:55
professionalParwej Ahamad31-Mar-10 18:55 
GeneralRe: Custom user control binding Pin
Joe Rozario31-Mar-10 21:00
Joe Rozario31-Mar-10 21:00 
AnswerRe: Custom user control binding Pin
Super Lloyd31-Mar-10 18:09
Super Lloyd31-Mar-10 18:09 
QuestionStrange window is shown every time i save a silverlight project Pin
jonatan_55629-Mar-10 0:51
jonatan_55629-Mar-10 0:51 
AnswerRe: Strange window is shown every time i save a silverlight project Pin
Abhinav S29-Mar-10 7:12
Abhinav S29-Mar-10 7:12 
GeneralRe: Strange window is shown every time i save a silverlight project Pin
jonatan_55629-Mar-10 22:27
jonatan_55629-Mar-10 22:27 
GeneralRe: Strange window is shown every time i save a silverlight project Pin
Abhinav S30-Mar-10 3:52
Abhinav S30-Mar-10 3:52 
QuestionTo generate Text boxes, Combo boxes, IP Address controls at runtime Pin
luckyshah29-Mar-10 0:32
luckyshah29-Mar-10 0:32 
AnswerRe: To generate Text boxes, Combo boxes, IP Address controls at runtime [modified] Pin
Parwej Ahamad29-Mar-10 9:49
professionalParwej Ahamad29-Mar-10 9:49 
GeneralRe: To generate Text boxes, Combo boxes, IP Address controls at runtime Pin
luckyshah29-Mar-10 22:02
luckyshah29-Mar-10 22:02 
QuestionBinding Double click Pin
Joe Rozario28-Mar-10 23:18
Joe Rozario28-Mar-10 23:18 
AnswerRe: Binding Double click Pin
Pete O'Hanlon29-Mar-10 0:00
mvePete O'Hanlon29-Mar-10 0:00 

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.