none
Start application with the window depending on the conditions PRISM MVVM RRS feed

  • Question

  • Hello, I have a question regarding the application written using the Prism Framework MVVM. I want to do this so that after running the application the login window is shown if the file is on the disk. If it does not exist, I want another window to show up when the application starts. I have no idea where to include the logic behind it. Maybe Bootstrapper like this: 

    protected override DependencyObject CreateShell()
            {
                
                if (File.Exists("file.dat"))
                return Container.Resolve<LoginWindow>();
                else
                    return Container.Resolve<OtherWindow>();
            }
    Please help.

    Friday, May 25, 2018 11:45 AM

Answers

  • Hi Lolex300,

    >>I have no idea where to include the logic behind it. Maybe Bootstrapper like this

    You're correct, Bootstrapper.CreateShell method is to creates the shell or main window of the application. So you can put your login inside it and determine which windows you need to load to the container.

    Reference: https://docs.microsoft.com/en-us/previous-versions/msp-n-p/gg431152(v=pandp.50)


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Lolex300 Monday, May 28, 2018 7:48 AM
    Monday, May 28, 2018 2:51 AM
    Moderator