Finally, Prism.MAUI is here! – How to install it

Prism Library

If you are a Xamarin developer like me and you also heard a lot about the new mobile environment from Microsoft (.Net MAUI), you will like this post.

Many mobile programmers who use Xamarin Forms to create applications, could use a Framework called Prism, a framework to create more maintainable applications using different design patterns like MVVM, dependency injection, commands, Event Aggregators etc., those things made Prism one of the most used framework for Xamarin Forms.

The most frequent question about .Net MAUI when they said MAUI could replace Xamarin as their mobile cross-platform environment was “What about the existing NuGet package and frameworks” and Yes, Prism was one of the things that people were worried about.

We recently got a twit from Dan Siegel (a Prism co-creator) that says we can start working with Prism in MAUI using a Nuget Template and now I will show you how.

The first thing you will do is open your Visual Studio 2022 and when it asks you to open a recent project or create a new one, click on “Continue without code”, here you will have the Visual Studio opened but empty and you will go for the Nuget Package Console as the following image.

You must copy and paste the following code in the console and press enter.

dotnet new --install Prism.Templates::8.1.97

When the installation ended, close the Visual Studio and open back again and in this case, you will select the option   “Create a New Project”, in the search box type “Prism” and now you will see the Prism.MAUI template already installed.

When you create the Project, this is how it looks.

PrismStartup here is where we now have our methods for instance our service and  set our navigation structure.

We still have the MauiProgram class, but in this case, instead of using “UseMauiApp” we are using “UsePrismApp” and we are passing PrismStartup.Configure method through it.

This is everything we know about Prism.MAUI for now, I’ll continue posting about Prism.MAUI, I think, and I hope they continue making improvements for this awesome framework I hope you like it, leave a comment, and ask what you want.

3 thoughts to “Finally, Prism.MAUI is here! – How to install it”

  1. thank you for this tutorial.
    i want to learn maui and prism. I’ve heard of prism and so here’s this little introduction that’s just right
    I hope the next course.

Leave a Reply

Your email address will not be published.