Xamarin.Forms Samples

Accessibility

This sample demonstrates how to use the AutomationProperties class, so that a screen reader can speak about the user interface elements on the page.

Accessing Native Views in Code

This sample demonstrates how to refer to native views declared in XAML, from code.

Bindable Layouts

This sample demonstrates binding a layout class to a collection of items, and setting the appearance of each item with a DataTemplate.

Bindable Picker

This sample demonstrates how to use a Picker to select a color from a list of colors.

BugSweeper

A familiar game with a new twist.

Button Demos

Demonstrates Button properties and events.

Circle Map Overlay

This sample demonstrates how to add a circular overlay to a map in order to highlight a circular area of the map.

ClassHierarchy

Demonstrates a scrollable hierarchy of all Xamarin.Forms classes, structures, and enumerations.

ContentPage Custom Renderer

This sample demonstrates a custom renderer for a ContentPage, enabling developers to override the default native rendering with their own platform-specific customization.

Days Between Dates

Demonstrates DatePicker and calculating a difference between two dates.

Dynamic ListView Row Resizing

This sample demonstrates using the Cell.ForceUpdateSize method to programmatically resize a ListView row at runtime.

Employee Directory

This is a Xamarin.Forms port of the pre-built sample app Employee Directory.

Entry Custom Renderer

This sample demonstrates a custom renderer for the Entry control, enabling developers to override the default native rendering with their own platform-specific customization.

FlexLayout Demos

Demonstrates common applications of the FlexLayout, and allows experimentation with its many properties.

Forms2Native

This sample demonstrates how to add native views to a Xamarin.Forms page, and how they can interact with Xamarin.Forms views.

FormsGallery

This program displays all the views, cells, layouts, and pages available in Xamarin.Forms, one per page.

GridLayoutDemo

This sample demonstrates how to display various UI elements in a grid.

HybridWebView Custom Renderer

This sample demonstrates a custom renderer for a HybridWebView custom control, that demonstrates how to enhance the platform-specific web controls to allow C# code to be invoked from JavaScript.

Hyperlinks

This sample demonstrates how Label and Span instances can be turned into hyperlinks.

Layout Compression

Layout compression removes specified layouts from the visual tree in an attempt to improve page rendering performance. This sample demonstrates how to enable layout compression, and the benefits it can bring when combined with fast renderers on Android.

LayoutOptions

Every Xamarin.Forms view has HorizontalOptions and VerticalOptions properties, of type LayoutOptions. This sample demonstrates the effect that each LayoutOptions value has on the alignment and expansion of a view.

ListView Colors

ListView Displaying System Colors using BoxView.

ListView Custom Renderer

This sample demonstrates a custom renderer that encapsulates platform-specific list controls and native cell layouts.

Map Custom Renderer

This sample demonstrates how to create a custom renderer for the Map control, which displays a native map with a customized pin and a customized view of the pin data on each platform.

Monkey App (CSS)

This sample demonstrates how to use CSS to perform basic styling in a Xamarin.Forms app.

Monkey Picker

This sample demonstrates how to populate a Picker with data by setting the ItemsSource property, and how to respond to item selection by the user.

Native Embedding

This sample demonstrates how to add platform-specific controls to a Xamarin.Forms layout, and includes how to override the layout of custom controls in order to correct their measurement API usage.

Native Switch

This sample demonstrates how to add native views to a Xamarin.Forms page, and how they can interact with Xamarin.Forms views.

PanGesture

This sample demonstrates using the PanGestureRecognizer class to implement dragging.

Picker

This sample demonstrates how to use a Picker to select a text item from a list of data.

PinchGesture

This sample demonstrates using the PinchGestureRecognizer class to implement interactive zoom functionality.

Platform Specifics

This sample demonstrates how to consume the platform-specifics that are built into Xamarin.Forms.

Polygon Map Overlay

This sample demonstrates how to add a polygon overlay to a map in order to highlight a region on the map. Polygons are a closed shape and have their interiors filled in.

Polyline Map Overlay

This sample demonstrates how to add a polyline overlay to a map. A polyline overlay is a series of connected line segments that are typically used to show a route on a map, or form any shape that's required.

Shadow Platform-Specific

This sample demonstrates how to expose an Effect through a platform-specific.

Slider Demos

Demonstrates the Slider view for selecting from a range of numeric values.

Solitaire Encryption (Xamarin.Forms)

Demonstrates the Solitaire encryption algorithm from Neal Stephenson's novel Cryptonomicon.

Stepper Demos

This sample demonstrates how to use a Stepper in code, XAML with code-behind, and XAML data-binding scenarios.

Subclassed Native Views

This sample demonstrates how to subclass native to define a XAML-friendly API.

SwipeGesture

This sample demonstrates how to use the SwipeGestureRecognizer class to recognize a swipe gesture.

TapGesture

This sample demonstrates working with tap gestures using Xamarin Forms.

TimePicker

This sample demonstrates how to use a TimePicker view to select a time, and respond to a time being selected.

Todo

This sample demonstrates a Todo list application where the data is stored and accessed in a local SQLite database.

TodoLocalized (Xamarin.Forms)

Demonstrates how to localize Xamarin.Forms using RESX.

TodoLocalized RTL (Xamarin.Forms)

Demonstrates how to right-to-left localize Xamarin.Forms apps.

Video Player Demos

This sample demonstrates renderers for a video player custom control.

View Custom Renderer

This sample demonstrates a custom renderer for a Xamarin.Forms custom control that's used to display a preview video stream from the device's camera.

ViewCell Custom Renderer

This sample demonstrates a custom renderer for a ViewCell that's hosted inside a Xamarin.Forms ListView control, enabling developers to override the default native rendering with their own platform-specific customization.

Visual State Manager Demos

Demonstrates some common usages of the Visual State Manager (VSM).

Weather App

Demonstrates a cross-platform app using Xamarin.Forms that retrieves data from a weather service.

Working with Colors

This sample demonstrates how to use Xamrin Form's flexible Cross-Platform Color class.

Working with Fonts

This sample demonstrates working with fonts using Xamarin Forms.

Working with ListView

These samples demonstrate how to work with ListView using Xamarin Forms.

WrapLayout

This sample demonstrates an orientation-sensitive WrapLayout class that arranges its children horizontally across the page, and then wraps the display of subsequent children to additional rows.

Xamarin Forms Image Resizer

Demonstrates how to cross-platform load, resize, and display an image on the screen.

Xamarin.Forms Text

This sample demonstrates the various views for displaying and entering text available in Xamarin.Forms.

Xuzzle

This sample implements the classic 14-15 puzzle using Xamarin.Forms.