Skip to content

danhermes/xamarin-xaml-book-examples

Repository files navigation

Building Xamarin.Forms Mobile Apps Using XAML

cover The xamarin-xaml-book-examples GitHub project contains the complete code examples for the book entitled Building Xamarin.Forms Mobile Apps Using XAML by Dan Hermes and Dr. Nima Mazloumi, published by Apress.

Xamarin.Forms has grown to be Xamarin’s most popular cross-platform offering. With Xamarin.Forms we allow developers to write their UI code once, and have it leverage the native controls everywhere. Many developers build Xamarin.Forms apps using XAML, which is what this book is about.

- Miguel de Icaza, Former CTO and co-founder, Xamarin


Many thanks to Mathieu Clerici for his work on this repo! Thanks also to Xamarin MVP Jason Awbrey and Alex Blount for their XAML contributions.

Thanks to Glenn Stephens, Senior Content Developer for the Xamarin platform at Microsoft, for his illuminating tech review!

What Is the Book About?

Leverage Xamarin.Forms to build iOS and Android apps using a single, cross-platform approach. This book is the XAML companion to Dan's C# guide: Xamarin Mobile Application Development.

You'll begin with an overview of Xamarin.Forms, then move on to an in-depth XAML (eXtensible Application Markup Language) primer covering syntax, namespaces, markup extensions, constructors, and the XAML standard. XAML gives us both the power of decoupled UI development and the direct use of Xamarin.Forms elements. This book explores the core of the Xamarin.Forms mobile app UI: using layouts and FrameLayouts to position controls and views to design and build screens, formatting your UI using resource dictionaries, styles, themes and CSS, then coding user interactions with behaviors, commands, and triggers.

You'll see how to use XAML to build sophisticated, robust cross-platform mobile apps and help your user get around your app using Xamarin.Forms navigation patterns. Building Xamarin.Forms Mobile Apps Using XAML explains how to bind UI to data models using data binding and using the MVVM pattern, and how to customize UI elements for each platform using industry-standard menus, effects, custom renderers, and native view declaration.

What Are These Chapters About?

The book begins with Xamarin.Forms and XAML, laying a solid foundation there before delving into how to use XAML to wield Xamarin.Forms. This book is laid out progressively from the most straightforward and foundational topics in Xamarin.Forms to the progressively more intricate and challenging. Each chapter is also laid out that way, beginning with the basics and proceeding into the more interesting concepts. Here are the chapters:

Chapter 1— Building Apps Using Xamarin
A Xamarin.Forms primer and a comparison of XAML vs. C# and Xamarin.Forms vs. platform-specific approaches, such as Xamarin.iOS and Xamarin.Android. Covers Xamarin.Forms solutions, pages, layouts, and views.

Chapter 2 — Building Xamarin.Forms Apps Using XAML
Explore XAML syntax and features, such as namespaces, markup extensions and how these are used in Xamarin.Forms. Use Constructors and Factory methods to instantiate your XAML classes. Learn all the ways that XAML elements are set and used including Property Element Syntax, Content Property Syntax, and Event Handler Syntax.

Chapter 3 — UI Design Using Layouts
Layouts help us organize the positioning and formatting of controls, allowing us to structure and design the screens of our mobile app.

Chapter 4 — Styles, Themes, and CSS
Using Resource libraries to centralize UI properties. Styles leverage this approach to provide an app-wide UI architecture for consistency, reusability, and maintainability. Themes further this approach with pre-fab but customizable styles. Follow the next iteration in Cascading Style Sheets (CSS) with XAML.

Chapter 5 — User Interaction Using Controls (Views)
Review Xamarin’s basic UI interactions: pickers, sliders, switches, and other controls. Create custom controls and control templates for reusable UI elements. Commands, Triggers, and Behaviors facilitate deeper connections between your UI and your code handlers.

Chapter 6 — Making a Scrollable List
Lists are one of the simplest and most powerful methods of data display and selection in mobile apps. Explore the power of the ListView and how to data bind, group list items with headers and footers, create user interaction with taps and context actions, and customize your rows.

Chapter 7 — Navigation
Navigation lets a user traverse an app, move from screen to screen, and access features. Hierarchical, modal, navigation drawers, drill-down lists, and other key patterns make up the core of mobile UI navigation. State management is the handling of data passed between screens as the user navigates through the app.

Chapter 8 — Custom Renderers, Effects, and Native Controls
Extend the capability of Xamarin.Forms views beyond their out-of-the-box functionality by customizing them using custom renderers, effects and native views. Xamarin.iOS and Xamarin.Android have scores of features inaccessible using only the Xamarin.Forms abstraction reachable using effects, custom renderers, and native views.

Chapter 9 — Local Data Access with SQLite and Data Binding
SQLite is a popular choice with many Xamarin developers and a greate place to start for learning mobile database access. Store and retrieve data locally by using SQLite-NET. Using Xamarin.Forms data binding, fuse UI elements to your data models. Use the MVVM pattern by binding to a view model.

Who Is This Book For?

This is book is for C# and ASP.NET developers, architects, and technical managers as well as many Android and iOS developers.

About

Building Xamarin.Forms Mobile Apps Using XAML - examples from the book by Dan Hermes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages