tags:

views:

104

answers:

2

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.

Cheers,

-- Lee

+1  A: 

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)

alimbada
Thanks for getting the ball rolling alimbada
Lee Englestone
A: 

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.

akjoshi
I like this. Where would you put Attached Properties / Behavior in this scheme tho? I break that out into a separate folder I call Behavior.
Berryl
I also have a 'core' project of wpf items that tend to be reusable across multiple projects. Things like Constants, Utilities, Controls and Behavior (which also likely have project specific counterparts)
Berryl
I have been tempted to change the name of Resources to Assets, only because resource is such a loaded concept, especially if you are dealing with localization. Cheers
Berryl
@Berryl - We also have a seprate project for Utilities and reusable classes but that's just not WPF specific. Renaming Resources to Assets is also a good idea, very refreshing.
akjoshi