Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Xamarin: Cross-Platform Mobile Application Development

You're reading from   Xamarin: Cross-Platform Mobile Application Development Master the skills required to develop cross-platform applications from drawing board to app store(s) using Xamarin

Arrow left icon
Product type Course
Published in Aug 2016
Publisher Packt
ISBN-13 9781787120129
Length 1049 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Jonathan Peppers Jonathan Peppers
Author Profile Icon Jonathan Peppers
Jonathan Peppers
George Taskos George Taskos
Author Profile Icon George Taskos
George Taskos
Can Bilgin Can Bilgin
Author Profile Icon Can Bilgin
Can Bilgin
Arrow right icon
View More author details
Toc

Chapter 4. Different Cars, Same Engine

In this chapter, we will cover the following recipes:

  • Sharing code between different platforms
  • Using the dependency locator
  • Adding a third-party Dependency Injection Container
  • Architecture design with Model-View-ViewModel (MVVM) pattern
  • Using the event messenger
  • Adding localization

Introduction

In this chapter, we will learn the different approaches, Shared Projects and Portable Class Libraries (PCL), to share code across all platforms.

DependencyService is the out-of-the-box service locator from Xamarin.Forms and we will learn how to use it to resolve implementation classes for our interfaces in runtime.

Using a service locator is a solution to register the implementation classes you need to use for your abstracted interfaces in the application. In this chapter, we will explore Xamarin.Forms' built-in DependencyService to map interfaces to implementation classes.

Moving forward, we will explore aspect oriented programming (AOP), which is accomplished...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime