Cross-platform, natively-backed UI toolkit. Xamarin.Forms is a cross-platform, natively-backed UI toolkit abstraction that allows developers to create user interfaces that can be shared across Android, iOS, and Windows Phone. Because the user interfaces use the native controls of the target platforms, they have the appearance and, importantly, the responsiveness of natively built apps.

Hello, Xamarin.Forms!

The user-experience of a Xamarin.Forms application is usually defined in a cross-platform shared project (either a Portable Class Library or a Shared Project) and combined with platform-specific projects that, at the least, initialize the native platform rendering (note the call to Forms.Init() in the platform code samples below) and, more generally, extend the user-experience and user-interface in platform-specific manners (for instance, by accessing platform-specific sensors or capabilities). The dependencies are one-way: the platforms depend on the shared project, but not vice-versa: The Solution Explorer for a cross-platform "Hello, World!" app might look like this: The shared portion of the Xamarin.Forms code might look like this: The iOS platform code would look like this: The Android platform code would look like this: And the Windows Phone code would look like this: The resulting app looks like this on the various devices:

Elements in Xamarin.Forms

Important types in the Xamarin.Forms namespace include , , and . s typically correspond with controller objects (Activities in the Android world, UIViewControllers in the iOS world), s with controls or widgets, and s arrange s on other s. These types are all derived from .

Model-View-ViewModel and Xamarin.Forms

Application developers use the Model-View-ViewModel (MVVM) pattern to create Xamarin.Forms apps that cleanly separate the concerns of data presentation and user interface from the concerns of data storage and manipulation. The framework enables this by providing, among a few other related types, the and classes. Objects that inherit from can be bound to members of type on other objects. A maintains dictionary of names and an association with their corresponding binding contexts--simply the object on which the is defined and that the application developer has assigned to the property--through a . See for more information.
Introduction to Xamarin.Forms Xamarin.Forms View Gallery