canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
988 stars 143 forks source link

Rationality behind the Pages folder #172

Closed ShuhuaGao closed 3 years ago

ShuhuaGao commented 3 years ago

In a typical MVVM project, we set up three folders: Models, ViewModels, and Views. However, the Stylet template generates a project with a "Pages" folder, which contains both the ShellView.xaml and the ShellViewModel.cs. Is there any special purpose for this structure?

In my opinion, the template is supposed to set up two folders in consistency with other codes: ViewModels containing the ShellViewModel.cs, and Views for the ShellView.xaml.

canton7 commented 3 years ago

You can do whatever you want: Stylet supports have views and viewmodels in separate folders.

The samples and tutorial use a Pages folder, because that is my personal preference and I wrote them. The template follows suit for consistency. You're free to change anything in a project generated from a template.