- 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.
- Learning SAP Analytics Cloud
- PLC編程及應用實戰
- Learning Python by Building Games
- Clojure Reactive Programming
- 劍指大數據:企業級數據倉庫項目實戰(在線教育版)
- MySQL從入門到精通(軟件開發視頻大講堂)
- Regression Analysis with Python
- Apache Camel Developer's Cookbook
- Kotlin極簡教程
- ABAQUS6.14中文版有限元分析與實例詳解
- Learning Unreal Engine Game Development
- C語言程序設計實驗指導與習題精解
- Web前端開發技術實踐指導教程
- C++面向對象程序設計教程
- JavaScript重難點實例精講