What is the recommended WPF application project structure?

Hi, I'm pretty new to WPF. I like the MVVM template (Model-View-ViewModel). My current project has the following type of file / namespace structure:

  Clients
    Controls
      ClientNameControl.xaml
      ClientSurnameControl.xaml
    Views
      ClientCapture.xaml 
    Models
      Client.cs
    ViewModels
      ClientViewModel.cs

Etc. With each domain object, such as customers, products, etc., each of which has the structure above. Controls are used to make representations, very general controls are divided into separate control projects and mentioned in the project. My question is, is this a useful structure? All MVVM examples seem to use the following approach to the namespace / namespace hierarchy:

  ViewModels
    ClientViewModel.cs
    ProductViewModel.cs
  Models
    Clients.cs
    Products.cs
  Views
    CliewntView
    ProductView

Any comments would be appreciated. Thanks in advance:)

: , . .

+3
1

View View. . -

 - 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

SO . WPF - WPF?

+2

Source: https://habr.com/ru/post/1762245/


All Articles