I’m just starting out with the Caliburn Micro WindowManager.
I have managed to display a modal dialog containing my WPF view.
I need to return an object from the dialog. What is the best way to do this?
Background – this is a login dialog. I need to validate the username and password and return user configuration information.
There are two ways I can think of to do this. I’m assuming your Login viewmodel class derives from Caliburn.Micro.Screen.
1) Have the view model (representing your login screen) expose a property that returns the user configuration. You can then access it upon a successful login like below:
2) Add the user configuration information to the application’s resource dictionary upon a successful login. The example below shows you setting this inside a “Login” method inside the login viewmodel.