Prism (For Xamarin Forms)

What is Prism?

Prism is a MVVM framework for Xamarin.Forms. Although Xamarin cannot be used for developing all kinds of application but Xamarin is one of the coolest technologies to make Hybrid Applications.

You maybe wondering that yeah Xamarin is cool but what is Prism doing here?

The reason prism is here because it makes our lives a lot easier.

As you should know we use MVVM i.e. Model View View Model for clean code in Xamarin.
But sometimes MVVM can be pain in the ass😞.So in order to simplify MVVM we use PRISM.

In Order to use prism,We have to download the prism template pack for visual studio.

To create a First application with Prism follow the steps below:

  •  After you’ve installed it, you will find in Visual Studio a new section called Prism, with various templates for each supported technology. The template we’re interested into is called Prism Unity App (Forms):
 Actually, this template has even an advantage over the standard Xamarin Forms template. As you can see from the image below, it allows you to choose which platform you want to target when you create your project, while the default Xamarin Forms template automatically creates a project for each supported platforms (Android, iOS, Windows Phone 8.1, Windows 8.1, UWP), even if you aren’t interested in targeting one of them.

After you’ve hit the Create project, you will end up with a standard Xamarin Forms solution: one Portable Class Library and one specific project for each platform you’ve chosen. Additionally, the Portable Class Library will already contain:
  • Views folder, where to place your pages. The template includes a default one, called MainPage.xaml
  • ViewModels folder, where to place your ViewModels. The templates includes a default one, called MainPageViewModel.cs.
  • An App class already configured to initialize the Prism infrastructure.
Here is how your default project will look like:

For Any Queries And Suggestions. Please Write Us In the Comments

Comments

Popular posts from this blog

FilePicker In Xamarin Forms

How to Use Media Picker In Xamarin Forms Portable

Scrolling Problem ListView in ScrollView (Solved)