Introduction

Completed

Note

.NET MAUI is the next evolution of Xamarin and what we recommend you develop mobile and desktop apps with, and you can learn more about .NET MAUI in several training modules. This Xamarin training module will not be maintained going forward.

Suppose you work for a power utility company as a mobile developer. You're responsible for improving the company's customer facing mobile app. Currently the app's UI is built using C# code. However, you've started to notice it's becoming more difficult to manage UI updates. This additional maintenance is because the app is getting more complex. It's difficult to read the core behavior logic as it's mixed in with UI code.

You want to find a solution that will introduce clean separation of UI and behavior. Separation of UI and behavior will allow your design expert to focus on what they do best, and you'll have time to focus on coding the behavior of the app. Xamarin.Forms lets you define your UI using the EXtensible Application Markup Language (XAML). XAML gives you a clean separation of user interface (UI) and behavior. XAML also makes it easier to use a design expert and design tools. In this module, you'll learn how to create Xamarin.Forms app that defines its pages and controls using XAML instead of C# code. Creating UI on XAML will allow you to separate all your UI code from your behavior code to make it easier to manage both.

Note

This module requires Visual Studio 2019. You can use either Windows or a Mac:

  • Windows: Make sure you have the Mobile development with .NET workload installed in Visual Studio 2019 for Windows. Refer to the documentation if you need to add it to your installation.
  • macOS: The standard Visual Studio 2019 for Mac installation includes everything you need to build mobile apps with Xamarin.

Learning objectives

In this module, you will:

  • Create the UI, and add controls for a Xamarin.Forms app using XAML
  • Access XAML-based UI elements from code
  • Subscribe to XAML-based UI events

Prerequisites

  • Visual Studio 2019 (any edition)
  • Familiarity with C# and .NET