- 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.
- Java Web開發之道
- Java開發入行真功夫
- C語言程序設計案例式教程
- Learning Python Design Patterns
- Vue.js 2 Web Development Projects
- Nagios Core Administration Cookbook(Second Edition)
- 零代碼實戰:企業級應用搭建與案例詳解
- Moodle 3 Administration(Third Edition)
- Android嵌入式系統程序開發(基于Cortex-A8)
- SAS編程演義
- Responsive Web Design with jQuery
- JBoss AS 7 Development
- WCF全面解析
- JavaScript Unit Testing
- Learning TypeScript