A while ago I wrote an article for Visual Studio magazine that details getting started with Xamarin.Forms and MvvmCross. Whilst some things have changed since then, the process for getting started is still basically the same. To verify this process I followed the article and took screenshots along the way – these mostly correspond to the screenshots that are in the article, with a couple of extras thrown in to ensure good coverage of the steps. Please follow the instructions in the article Build a Xamarin.Forms Application with MvvmCross:
Create the new solution
Pick the Blank template using the .NET Standard library
Note that the order of the Code Sharing Strategy has changed, placing .NET Standard as the default (about time!!!)
Add a new Core library
Add reference to the Core library to each project
Update existing NuGet packages
Add reference to MvvmCross to ALL projects
Add reference to MvvmCross.Forms to all EXCEPT the Core project
Add App class to Core project and add necessary using statements
Update the MainPage to use the MvxContentPage as base class and in Views namespace
Don’t forget to update the code-behind file – Remove base class and update namespace
UWP: Change MainPage to inherit from MvxFormsWindowsPage and fix using statement
UWP: The updated MainPage
UWP: The updated MainPage code-behind file
UWP: Update the App class to inherit from ProxyMvxApplication
UWP: The ProxyMvxApplication class and the App code-behind
Note: I cheated here for the screenshot and had these in the same file. I would recommend having the ProxyMvxApplication in a separate file
Android: Error when building
Android: Add reference to Mono.Android.Export
Android: Change MainActivity to RootActivity and inherit from MvxFormsAppCompatActivity
iOS: Update AppDelegate to inherit from MvxFormsApplicationDelegate
I hope these screenshots help anyone who runs into issues getting started when following the Visual Studio Magazine article
———-
Contact Built to Roam for more information on building cross-platform applications
———-