none
App.xaml and Application_Startup()

    Question

  • Hello:
     
    Well folks this WPF and MVVM is an adventure that's for sure. What I
    have so far is the start of MVVM with Controller.
     
    I can get to the controller.Start() through the Application_Startup() of
    the App.xaml.cs.
     
    I have a PayrollView.xaml and a PayRollViewModel.cs
     
    In the controller.Start() how do I make the PayRollView.xaml show on the
    screen?
     
    Thursday, March 01, 2012 3:42 AM

Answers

  • Thanks I came past that problem by using source code from demo project
    and talking to some guys at work. Yeah I found out  that a MainPage is
    needed before you can show usercontrols.
     
     
    Monday, March 05, 2012 11:22 AM

All replies

  • If your application does not have any main window, you cannot show any XAML or View on the screen. So you have to build a view as the Application Main Window, and show it first. Then you could host your *.xaml content as the child in the MainWindow. Or you could show your Window View as the Main Window of the application. I recommend you to download thePrism project, it has a sample named "Hello World". That contains a class "Bootstrapper" class which set the main window for app, you could learn the architecture from Prism.

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 05, 2012 6:19 AM
    Moderator
  • Thanks I came past that problem by using source code from demo project
    and talking to some guys at work. Yeah I found out  that a MainPage is
    needed before you can show usercontrols.
     
     
    Monday, March 05, 2012 11:22 AM