Chapter 2. Declare Once, Visualize Everywhere
In this chapter, we will cover the following recipes:
- Creating a tabbed-page cross-platform application
- Adding UI behaviors and triggers
- Configuring XAML with platform-specific values
- Using custom renderers to change the look and feel of views
Introduction
Xamarin.Forms is a cross-platform UI framework. So far, we have seen examples of creating the UI in code using procedural code, creating objects, wiring them to events, and adding them to collections. That's OK, but when it comes to a more complicated UI structure, this code can get very large, hard to understand, and difficult to visualize what has been created.
Another limitation is that we mix design code and behavior, which can become difficult to separate the roles between developer and designer, and also concerns like colors and fonts.
This is where XAML comes to save us from the pain. It is a markup language originally created by Microsoft to describe the user interface in Windows...