Book Image

Xamarin 4 By Example

By : Engin Polat, Mark Radacz
Book Image

Xamarin 4 By Example

By: Engin Polat, Mark Radacz

Overview of this book

The mobile app market is increasing exponentially every year. Xamarin Studio with its modern and powerful IDEs makes creating applications a lot easier by simplifying the development process. Xamarin will allow you and your team to create native applications by taking advantage of one of the most evolved programming language in the world: C#. This book will provide you with the basic skills you need to start developing mobile apps using C# and Xamarin. By working through the examples in each chapter, you will gain hands-on experience of creating a complete app that is fully functional by all means. Finally, you will learn to publish the app you created on the app market. Each project in this book will take you one step closer to becoming a professional app developer.
Table of Contents (16 chapters)
Xamarin 4 By Example
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
7
Monkey Puzzle Game – Processing Images

MVVM pattern example – split the bill


It's now time to develop our very first cross-platform library.

Idea

The idea is to make a library that allows us to write the total of the bill, the percentage of the total tip and the number of people, giving us the total per person.

Design

At a sketch level, we want a user interface that calculates the bill for each person, having as inputs the current bill, the percentage of tip and the number of people.

Development

Projects with MVVM in mind are normally structured with:

  • One shared "core" PCL project containing as much code as possible: models, view models, services, converters, and so on

  • One UI project per platform, each containing the bootstrap and view-specific code for that platform

We will start to develop this from the core project, which will contain our Model and ViewModel. We will start the next chapter by analyzing how to use the core library in the platform specific UI.

To create the core, we can use the Xamarin Studio project template PCL Project...