CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2010
    Posts
    1

    Getting 2 MainWindows

    this is my code.

    the idea being to set the data context of the MainWindow.
    However, I am given 2 main windows, one blank, one with all the stuff in the view model.
    (I was attempting to replicate the example here
    http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
    for my own objects.)


    protected override void OnStartup(StartupEventArgs e)
    {
    base.OnStartup(e);
    MainWindow window = new MainWindow();
    var viewModel = new AllConversationsViewModel();
    MainWindow.DataContext = viewModel;
    window.Show();
    }


    any clues?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Getting 2 MainWindows

    Were you able to get the code that came with the example running?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured