At the time of the development of a multi-pages website or mobile application, the page navigation feature is its must requirement. If you are developing an app under the Xamarin technology with the Xamarin.Forms then you have to be thankful to its prism library. The individuals who are still not know the facts and features of Prism have to become familar with it first that Prism is a XAML application framework with having some in-built key features like:
- MVVM Supportive
- Navigation and more.
Now coming back to the main topic of our this blog post as how can we create a page navigation menu in the Xamarin.Forms with the Prism. So, to go forward this, at first you need to create a new project, with this you also need some nudget packages to getting started working with prism.
Now create three different folders in your project as with the name od Models, Views, and ViewMoels, before to install the nudget package. In this chapter you need to install three pagkages in it which are as:
Now start the installation process of these nudgets in your project by hitting the right click of your mouse on the solution. After the successful installation, edit some code lines in the file App.xaml and App.cs
Do the following code changes in App.xaml file:
|<!– Application resource dictionary –>|
Do the following code changes in App.cs file:
Simply here we can see two new methods as RegisterTypes and OnInitialized. From which here we are using registertype method for registering the navigationin the app.
Create a new masterDetail page in your project’s View with ViewModel, by the use of prism libraby which is called ViewModelLocator.AutowireViewModel. You need to add this namespaces in this file like: