MVVM and Login Windows -


I am writing my first "real" MVVM application, and the first step is to provide login to the user credentials. Last time, I had shown the login dialog for the first time after the main window was placed and it will be visible for the first time.

What is the best way to do this in the world of MVVM, and why?

I see many options, one of which is the way I have done it before, to continue it, because it is a one step and the rest is in "MVVM-RAS" Will not interfere "After the user of the application is logged in, I can start ModelView of MainWindow with my code and then continue on my way. Another option is that the ModelView The login dialog should be displayed (in some way). MVVM Guru likes one of these?

(Another option, which is showing the first sign dialog, and then when it is rejected, make the main window. It is technically My dilemma will solve, but it does not really teach me, nor do I like the aesthetics of the "nude" login dialog.)

Model-view-view model pattern does not tell us that the UI workflow How to define. We are free to choose one suitable workflow. I would like your first approach because it is simple and straightforward to implement Workflow:

  1. Below the main window
  2. Show the login dialog
  3. Start the main window with the user credentials

An controller (such as the application The responsibility of the controller) . How it can appear in the ViewModel sample application of

.

Comments