Xamarin 101: Two Easy Ways to Get Started With MvvmCross

In this post, we will try the 2 easy ways on how to bring MvvmCross into your Xamarin app.

There are two Visual Studio extensions that we will use here. Let’s try the first one and see the steps.

Step 1:

Go to Extensions and Updates. Search for MvvmCross. Then install MvvmCross for Visual Studio by Jim Bob Bennett

FYI: Jim Bennett also wrote this amazing Xamarin In Action. I read the early access program of the book last month and found how incredible this book is. If I were just starting to learn Xamarin, I will definitely buy this book and read it twice.

Step 2:

Go to File -> New -> Project

Step 3:

Create a new project using the MvvmCross Application.

Step 4:

Take a look at the projects (Portable Class Library, Android, iOS, UWP, and WPF ) created by the MvvmCross extension for you.

Step 5:

Rebuild the solution.

Step 6:

View all your projects and see the basic structure and default files made by the extension for you.

Step 7:

Check out the installed NuGet packages automatically done for you by MvvmCross extension.

Step 8:

Build and deploy your first MvvmCross Xamarin app to Android or iOS.

Step 1:

Search Xablu in your extensions and updates menu then install XabluCross for MvvmCross.

Step 2:

Again, go to File -> New -> Project

Step 3:

Create a new project using MvvmCross with XabluCross

Step 4:

A XabluCross dialog box will appear. You can uncheck the tools that you will see on the box and proceed. But for now, just leave them checked and click the next button.

Step 5:

Decide whether you want to use all the available platforms or not.

Step 6:

Leave the radio button on Navigation drawer and hit next.

Step 7:

You can choose the MvvmCross version and the optional NuGet packages you want for your app. The extension will install them during the creation of your project.

Step 8:

Step 9:

Enter your HockeyApp IDs. I think this needs to be updated and make the form also applicable to Visual Studio App Center’s app secrets.

Step 10:

Review your configuration then click on the finish button.

By the way, there’s feedback button where you can submit any comments or suggestions to Xablu. This will help them improve this Visual Studio extension that they made.

Step 11:

Build and deploy your first MvvmCross Xamarin app to Android or iOS.

You might be surprised that I didn’t include here a screenshot of the running Android project of this demo app. Well, it’s not working right now for some reason. It used to work before the update of the Visual Studio 2017 version 15.5

Anyway, I will update this post once the XabluCross for MvvmCross extension get fix. But that shouldn’t stop you from trying out both these amazing Visual Studio extensions for MvvmCross. So what are you waiting for? See it for your self. Happy coding!