Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended WPF Project Structure?

I'm a stickler for good Visual Studio Solution and Project structures.

I'm about to start a WPF proof of concept piece of work.

Can anyone recommend some WPF Project structures they have used and found worked well?

Here http://drwpf.com/blog/2007/10/01/58/

They have one recommendation which I like:

    Root
    - Pages
    - Controls
    - Resources
    App.xaml

Where Pages, Controls and Resources are folders.

Has anyone found certain structures work well / don't work well?

Also I'd rather not get into a 'Model View Presenter' discussion if that's ok with you guys.

like image 826
Lee Englestone Avatar asked Aug 06 '10 10:08

Lee Englestone


2 Answers

I agree with alimbada. We have also created different projects for View and View models. It makes things easier to maintain in case of huge projects. Directories we had were -

 - ViewsRoot
    + Base
    + Controls 
    + Documentation 
    + Forms(Windows)
    + Reports
    + Resources 
    + Themes 
    + Utilities 
    App.xaml

 - ViewModelsRoot
    + Collection
    + Commands
    + Converters
    + Resources 
    + TemplateSelectors
    + ViewModels
    + Views (Interfaces for views) 
    Constants.cs 
    Utility.cs

I also believe in planning the structure in advance, this makes easy for all developers to get used to it and follow the same. Doing this later adds confusion and is painful in case you have to create seprate projects. Thats my view and am open to know of other better approches for this.

like image 71
akjoshi Avatar answered Oct 21 '22 17:10

akjoshi


I tend to have the following directories: Converters, Models, Resources, ViewModels and Views.

I've also seen a solution where the View and ViewModels have been split out into separate projects (see BubbleBurst on CodePlex)

like image 36
alimbada Avatar answered Oct 21 '22 17:10

alimbada