Making your application easier to evolve
When you build applications with the MVVM pattern, one of the consequences is that you start to move all the data layers into separate classes, maybe even into separate class libraries. As mentioned at the beginning of this chapter, in fact, ideally the model should be completely platform-agnostic and you should be able to reuse the same classes also in any other .NET project, such as a Blazor web app or an ASP.NET Web API.
Let's come back to our example of a page that contains a form to add a new user. If we follow the principle of isolating the model, it means that your ViewModel should never contain code like this:
public MainViewModel() { SaveCommand = new RelayCommand(SaveAction, () => !string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(Surname)); } public RelayCommand SaveCommand ...