Book Image

Xamarin Cross-platform Application Development - Second Edition

By : Jonathan Peppers
Book Image

Xamarin Cross-platform Application Development - Second Edition

By: Jonathan Peppers

Overview of this book

<p>Developing a mobile application for just one platform is becoming a thing of the past. Companies expect their apps to be supported on both iOS and Android, while leveraging the best native features on both. Xamarin's tools help ease this problem by giving developers a single toolset to target both platforms.</p> <p>This book is a step-by-step guide to building real-world applications for iOS and Android. The book walks you through building a chat application, complete with a backend web service and native features such as GPS location, camera, and push notifications. Additionally, you'll learn how to use external libraries with Xamarin and Xamarin.Forms to create shared user interfaces and make app-store-ready applications. This second edition has been updated with new screenshots and detailed steps to provide you with a holistic overview of the new features incorporated in Xamarin 3. By the end of the book, you will have gained expertise to build on the concepts learned and effectively develop a market-ready cross-platform application.</p>
Table of Contents (19 chapters)
Xamarin Cross-platform Application Development Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Learning the MVVM design pattern


The Model-View-ViewModel (MVVM) design pattern was originally invented for Windows Presentation Foundation (WPF) applications using XAML for separating the UI from business logic and taking full advantage of data binding. Applications architected in this way have a distinct ViewModel layer that has no dependencies on its user interface. This architecture in itself is optimized for unit testing as well as cross-platform development. Since an application's ViewModel classes have no dependencies on the UI layer, you can easily swap an iOS user interface for an Android one and write tests against the ViewModel layer.

The MVVM design pattern is also very similar to the MVC design pattern discussed in the previous chapters.

The MVVM design pattern includes the following:

  • Model: The Model layer is the backend business logic that drives the application and any business objects to go along with it. This can be anything from making web requests to a server to using...