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.

7 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.

  2. Hola Steven, saludos desde chile, te comento hice todos los pasos y todo okey pero cuando quiero ocupar NavigateAsync como lo hiciste en el video que subiste en youtube (Empezando con Prism para NET MAUI) no funciona. Ademas que el nuget que instalaste (Prism.Dryloc.Maui) no se encuentra en administración de paquetes nuget

    1. Saludos Alejandro, gracias por tu comentario, en efecto, es muy posible que no te funcione a la fecha, ya que el nugget ha sufrido cambios y han deprecado esa version que utilice, el tutorial lo cree muy justo a la fecha que Prism anuncio su salida a MAUI, por eso quizas no te aparezca tampoco el nugget, en la ventana de nugget package manager, hay una casilla, al lado del buscador, que dice “Incluir Pre Releases”, para que te salgan los paquetes que no estan públicos, que en su momento, fue el que utilice… me dices si te funciona…, cualquier cosa, nos contactamos por correo para poder ayudarte.. un placer

Leave a Reply

Your email address will not be published.