
There are two common approaches to using Xamarin to build mobile applications:
Let's explore Xamarin.Forms in more detail.
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.
In this video we will compare Xamarin.Forms XAML to Microsoft XAML.
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.
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.