- Xamarin Blueprints
- Michael Williams
- 215字
- 2021-07-08 11:48:21
Cross-platform development with Xamarin.Forms
The key ingredient in cross-platform development with Xamarin is code sharing. Sharing native code is great, but we still have the issue of writing separate user interface code for each platform. The Windows Presentation Framework (WPF) is a presentation system which uses an XML-based language known as Extensible Application Markup Language (XAML). Xamarin.Forms uses WPF and the Model-View-View-Model (MVVM) paradigm to build native user interfaces from a single C# shared code base, whilst maintaining access to all native APIs on each platform.

The preceding diagram represents a native architecture. We keep all the sharable code Inside the Shared C# App Logic block (normally a shared project) for each platform project to access, i.e. the GalleryItem
class would be kept here since it is shared between both projects.
So how would this look in Xamarin.Forms?
Using Xamarin.Forms
, since we have the ability to share the user interface screens, we can share the entire view and view model code between all platforms:

In the preceding diagram, the code contained in the Shared C# App Logic block is contained in a Portable Class Library (PCL), which each native project will import. Xamarin.Forms
makes it possible to share up to 85% of code.
Let's now delve into development and setup our first Xamarin.Forms
project.
- Building Modern Web Applications Using Angular
- SOA實踐
- CentOS 7 Server Deployment Cookbook
- Vue.js快速入門與深入實戰
- WSO2 Developer’s Guide
- Python進階編程:編寫更高效、優雅的Python代碼
- Python高級機器學習
- PLC編程與調試技術(松下系列)
- Learning Hunk
- Building Serverless Applications with Python
- 青少年學Python(第1冊)
- C語言程序設計
- Learning Continuous Integration with TeamCity
- Julia for Data Science
- MySQL入門很輕松(微課超值版)