This is a basic app that let you create a sample Xamarin Project Contains HamburgerMenu, MVVM Project Setup and ListView which shows contact details.
This project was made by learning Xamarin Forms and see how it interacts with other layers of the application. When I started learning Xamarin development, I couldn't find sample projects in MVVM architecture. So I searched through web and developed my own. I posted this so that this project might be helpl those people who started learning xamarin Forms. I'm still learning. This project is merely my attempt to put something together based on the learning put across youtube and Udemy couses and in the official Microsoft documentation.
This project will run in Windows ,iOS and Android. Currently I have only developed only for Android. You guys can easily add an iOS or Windows project. Below procedure shows how to run this for iOS and Windows.
It might seem like a hack, but when I need to do this I follow these steps:
-
You need to create a totally new Xamarin.Forms solution in a temporary location on the Mac with exactly the same name as the existing project. Close the solution.
-
Copy the platform project you need (in this case the iOS project folder) into your existing solution folder using Finder.
-
Open your existing solution, right-click Add existing project and then choose the new project.
-
Because the new solution you made had the same name, the namespace and other settings should all match, and the references should 'just work'. If the reference to the common code didn't work, delete and re-add it. Also don't forgot to synchronize the version of Xamarin.Forms NuGet being used.
Note: it is also possible to just create a 'new' iOS project, add the Xamarin.Forms NuGet and
then copy the required AppDelegate.cs code from another Xamarin.Forms solution,
but I find the above process easier.
The Model-View-ViewModel (MVVM) pattern helps to cleanly separate the business and presentation logic of an application from its user interface (UI). Maintaining a clean separation between application logic and the UI helps to address numerous development issues and can make an application easier to test, maintain, and evolve. It can also greatly improve code re-use opportunities and allows developers and UI designers to more easily collaborate when developing their respective parts of an app. There are three core components in the MVVM pattern: the model, the view, and the view model. Each serves a distinct purpose.
1. Add New Contacts 2. Edit Existing Contacts 3. Shows List of contacts 4. Hamburger Menu
5. Call the contact directly
6. Delete Contact
Going to implement a local database to project -> To Save and Edit contact details for real time usage. I'll implement lot more features whenever something popup in my mind.
As I mentioned above I have implemented local database to this project and
pushed it into new repo named Xamarin_Contacts. Go ahead and refer that
repository link which I mentioned below. I have implemented local database
SQLite and developed in MVVM architecture(Mostly every features are fall under MVVM).
Consider star the repo if you like it.Thanks
Xamarin_Contacts Repository(Used SQLite and also in MVVM Pattern)
This is my second project,in this project I have also implemented local database to this project and
pushed it into new repo named Xamarin_MVVM_ContactsBook. Go ahead and refer that
repository link which I mentioned below. I have implemented local database
SQLite and developed in MVVM architecture(Every features are fall under MVVM Pattern).
Consider star the repo if you like it.Thanks
Xamarin_ContactsBook Repository(Used SQLite and also in MVVM Pattern)
I'll constantly update this project whenever I find the great coding standards and better architecture. I still getting feedback abovt my MVVM project structure. So when you came across any error or better method to do code , feel free to raise a issue or contact me via Twitter
Follow me on Twitter to get the latest update about features, code and more. Consider star the repo if you like it.