Xaml WPF MVVM NameSpace & New Project Folder, InitializeComponent(); StartupUri=

Viewed 969

I create some folder and organise my files to keep the MVVM Pattern clean. Model Folder, View Folder and ViewModel Folder.

It creates namespace problems, on many levels.

First the InitializeComponent();

  • does not exist in the current context

Second the StartupUri=

  • Can't find the ressources

I could find some answers but none were complete. From the basic situation:

  1. I create a new project WPF c# (Lets Name it PROJECT)
  2. I create 3 new folder.
  3. I move the MainView to the View folder.

What should be in PROJECT\app.xaml ?

  • x:Class=""
  • StartupUri=""

What should be in PROJECT\View\MainWindow.xaml ?

  • x:Class=""

What should be in PROJECT\View\MainWindow.xaml\MainWindow.cs ?

  • namespace

What about the PROJECT\ViewModel\FooViewModel.cs ?

What about the PROJECT\Model\FooModel.cs ?

And why ?

So furthe similar question could be completely anwsered. Thanks a lot

1 Answers
Related