Click here to Skip to main content
14,869,580 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: No experience, learning C# & WPF Pin
Pete O'Hanlon30-Mar-10 21:48
mvePete O'Hanlon30-Mar-10 21:48 
GeneralRe: No experience, learning C# & WPF Pin
Jammer1-Apr-10 14:17
MemberJammer1-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
MemberJammer12-Apr-10 10:52 
GeneralRe: No experience, learning C# & WPF Pin
Jammer1-Apr-10 14:09
MemberJammer1-Apr-10 14:09 
GeneralRe: No experience, learning C# & WPF Pin
tim.gent@gmail.com2-Apr-10 0:22
Membertim.gent@gmail.com2-Apr-10 0:22 
GeneralRe: No experience, learning C# & WPF Pin
Jammer2-Apr-10 6:06
MemberJammer2-Apr-10 6:06 
QuestionMVVM Pin
DoctorMick30-Mar-10 4:30
MemberDoctorMick30-Mar-10 4:30 
Hello all,

I'm fairly new to Silverlight and MVVM and I'm struggling with the correct way of doing the simple task of changing the top level silverlight view. Using Silverlight 4 commanding I am binding a command on my view model to a login button on my main form and then calling an authentication service to ensure the credentials are valid, this is working and I can authenticate the user. What I am struggling with is the best way of closing the login screen and displaying another screen when I get a successful response from my service. From what I understand you cannot hook a callback event in the view to a command object and I should also be trying to avoid having any code behind in the view so where do I control the opening of a new view? Obviously, my ViewModel should know nothing about the view so I can't do it there, can I?

The way I was going to approach it is still use the button bound to a command on the view model but use a bit of code in the view to hook an event to the view model which is fired when I get the successful login from the service. The event hooked up in the view would then control switching the views but from the examples I have looked at I am not convinced this is the best way forward.

Am I missing something obvious or looking at the problem in completely the wrong way?

I'm hopeful this question will have a straight forward answer but after hours of browing examples on the web I'm still none the wiser as to the correct approach.
AnswerRe: MVVM Pin
Abhinav S30-Mar-10 4:42
MemberAbhinav S30-Mar-10 4:42 
QuestionCustom user control binding Pin
Joe Rozario29-Mar-10 18:42
MemberJoe 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
MemberJoe 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
MemberJoe Rozario31-Mar-10 21:00 
AnswerRe: Custom user control binding Pin
Super Lloyd31-Mar-10 18:09
MemberSuper Lloyd31-Mar-10 18:09 
QuestionStrange window is shown every time i save a silverlight project Pin
jonatan_55629-Mar-10 0:51
Memberjonatan_55629-Mar-10 0:51 
AnswerRe: Strange window is shown every time i save a silverlight project Pin
Abhinav S29-Mar-10 7:12
MemberAbhinav S29-Mar-10 7:12 
GeneralRe: Strange window is shown every time i save a silverlight project Pin
jonatan_55629-Mar-10 22:27
Memberjonatan_55629-Mar-10 22:27 
GeneralRe: Strange window is shown every time i save a silverlight project Pin
Abhinav S30-Mar-10 3:52
MemberAbhinav S30-Mar-10 3:52 
QuestionTo generate Text boxes, Combo boxes, IP Address controls at runtime Pin
luckyshah29-Mar-10 0:32
Memberluckyshah29-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
Memberluckyshah29-Mar-10 22:02 
QuestionBinding Double click Pin
Joe Rozario28-Mar-10 23:18
MemberJoe Rozario28-Mar-10 23: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.