Posts about .NET MAUI

Avoid async calls in view model constructors

October 21st 2022 MVVM .NET MAUI

The view models in the MVVM pattern are responsible for providing data for the view. It may be tempting to load the data in the constructor of the view model. But if the methods to load the data are asynchronous, they must then be called in a blocking manner. Even if we ignore the danger of deadlock, this is not a good idea.

Fix broken .NET MAUI templates

September 9th 2022 .NET MAUI Visual Studio

When I started working with .NET MAUI, I immediately noticed that the code files generated by the project template use tabs instead of spaces for indentation (unlike all other .NET project templates). This bothered me, but fortunately it can be easily fixed.