
Install Xamarin to start cross-platform development on Mac or Windows, connect to a Mac for iOS builds, and test with iOS, Android, and Windows emulators and simulators.
There are two common approaches to using Xamarin to build mobile applications:
Let's explore Xamarin.Forms in more detail.
Learn to create a Xamarin.Forms app by selecting blank templates, generating cross‑platform projects for iOS, Android, and Windows Phone in Visual Studio, and managing NuGet packages and updates.
Now that you have created and run a Xamarin.Forms application, let's look at what you've built and begin to understand the working components.
There are two types you will work with in the cross-platform code to build your Xamarin.Forms application:
ApplicationPageThe Application class is the cross-platform entry point for your application.
The Page is used to display a single screen to the user.
Application class will always identify the starting page through a property and then you can create other pages to navigate to through various built-in mechanisms.Let's look at these two classes in a bit more detail.
Explore how Xamarin.Forms layout containers organize views with stack, grid, scroll, and relative/absolute layouts, using orientation, spacing, padding, and size requests to create adaptive, ordered UIs.
Learn how Xamarin.Forms enables platform specific code in shared projects, using device on platform delegates and device on platform T to tailor behavior for iOS, Android, and Windows Phone.
Learn how XAML defines the user interface for Xamarin.Forms, offering a markup approach that separates UI from behavior and enables tool-friendly design and a clear division of labor.
In this video we will compare Xamarin.Forms XAML to Microsoft XAML.
Discover how Xamarin.Forms markup extensions produce runtime values to replace literal XML, using static extension, x:type, and x:array to access members, types, and collections.
If you ever find yourself copying-pasting XAML, you might want to consider packaging your XAML and the associated code-behind into a unit that you can reuse on other pages or other applications.
Here we will look at a built-in control, the ContentView to achieve this. A ContentView is a reusable XAML block, which can then be included on one or more screens. It is similar to a UserControl in the Windows world, or a Fragment in Android. ContentView works very much like ContentPage – it consists of a XAML markup file which describes the UI fragment you are building, and an associated code behind file where you can interact with that UI. The difference is this isn't a complete page – it's just a part of the page. You can include custom properties and events in the ContentView to allow the consumer of the view to customize the information or receive updates in the form of events.
Let's look at this concept in more detail.
Centralize UI values with a resource dictionary and per-page resources, using static resource lookups to enable easy updates and platform-specific colors.
Learn how to update Xamarin.Forms resources at runtime using dynamic resources and the resource dictionary, with code-behind set dynamic resource and dynamic resource markup extension to refresh UI color scheme.
Explore how styles in Xamarin.Forms reduce repetition and improve startup time by grouping property setters in a resource dictionary, with implicit styles and static or dynamic resources for consistency.
Xamarin.Forms is perfect for cross-platform applications that display "forms over data" where the primary goal of the application is to display data in a standardized way. This course focuses on the foundations of building Xamarin.Forms applications that target iOS, Android and Windows. In this course you will define a single UI that you share across all your supported platforms. You will also see how to access platform-specific features such as the phone dialer or camera.