tag Samples

Accessing Native Views in Code

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

Attached Behaviors

A behavior that's attached to a control through attached properties is known as an attached behavior. This sample demonstrates creating and consuming an attached behavior.

Azure Search

This sample demonstrates how to use the Microsoft Azure Search Library to integrate Azure Search into a Xamarin.Forms application.

Azure Storage

This sample demonstrates how to use Xamarin.Forms to store text and binary data in Azure Storage, and how to access the data.

AzureADB2CAuth

This sample demonstrates how to use Microsoft Authentication Library and Azure Active Directory B2C to integrate consumer identity management into a mobile application.

BackgroundColor Effect

This sample demonstrates creating an effect for the Entry control, that changes the background color of the control.

Basic Animation

The ViewExtensions class provides extension methods that can be used to construct simple animations. This sample demonstrates creating and canceling animations using the ViewExtensions class.

BasicStyles

Xamarin.Forms applications often contain multiple controls that have an identical appearance. Setting the appearance of each individual control can be repetitive and error prone. Instead, styles can be created that customize control appearance by grouping and settings properties available on the control type. This sample demonstrates using the Style class to create styles.

BoxViewClock

A classic analog clock but realized entirely with BoxView.

BugSweeper

A familiar game with a new twist.

ButtonCode

This program demonstrates how to create a Button in code and process events from it.

ButtonXaml

Demonstrates how to create a Button in XAML and process its events in a code-behind file.

CarouselPage

This sample demonstrates how to use a CarouselPage to navigate through a collection of pages. The CarouselPage is constructed by populating it with a collection of child Page objects.

CarouselPageTemplate

This sample demonstrates how to use a CarouselPage to navigate through a collection of pages. The CarouselPage is constructed by assigning a collection to the ItemsSource property and assigning a DataTemplate to the ItemTemplate property to return pages for objects in the collection.

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.

CocosSharp and Xamarin Forms

A simple project showing how to combine Xamarin.Forms with CocosSharp.

Coerce Value Callback

A bindable property is a special type of property, where the property's value is tracked by the Xamarin.Forms property system. This sample demonstrates using a coerce value callback to force a re-evaluation of a bindable property when the value of the property changes.

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.

Custom Animations

The Animation class is the building block of all Xamarin.Forms animations, with the extension methods in the ViewExtensions class creating one or more Animation objects. This sample demonstrates how to use the Animation class to create and cancel animations, synchronize multiple animations, and create custom animations that animate properties that aren't animated by the existing animation methods.

Data Template

This sample demonstrates creating a DataTemplate to specify the appearance of data being displayed by a ListView.

Data Template Selector

This sample demonstrates using a DataTemplateSelector to select a DataTemplate at runtime per item in a ListView.

Deep Linking

Application indexing allows applications that would otherwise be forgotten after a few uses to stay relevant by appearing in search results. Deep linking allows applications to respond to a search result that contains application data, typically by navigating to a page referenced from a deep link. This sample demonstrates how to use application indexing and deep linking to make Xamarin.Forms application content searchable on iOS and Android devices.

Displaying Pop-ups

This sample demonstrates using the alert and action sheet APIs to ask users simple questions and guide users through tasks.

Dynamic ListView Row Resizing

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

DynamicStyles

This sample demonstrates how to use dynamic resources to make applications respond to style changes dynamically at runtime.

Easing Functions

Xamarin.Forms includes an Easing class that allows you to specify a transfer function that controls how animations speed up or slow down as they're running. This sample demonstrates how to consume the pre-defined easing functions, and how to create custom easing functions.

Effect Behavior

Behaviors are a useful approach for adding an effect to a control, removing boiler-plate effect handling code from code-behind files. This sample demonstrates using a behavior to add an effect to a control.

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.

Event to Command Behavior

In the context of commanding, behaviors are a useful approach for connecting a control to a command. In addition, they can also be used to associate commands with controls that were not designed to interact with commands. This sample demonstrates using a behavior to invoke a command when an event fires.

Focus Effect

This sample demonstrates creating an effect for the Entry control, that changes the background color of the control when it gains focus.

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.

Hierarchical Navigation

This sample demonstrates how to perform hierarchical navigation through a stack of pages in Xamarin.Forms.

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.

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 Custom Renderer

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

LoginFlow

This sample demonstrates how to manipulate the navigation stack in order to only display the main page of the application once the user has successfully logged in.

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.

MasterDetailPage

This sample demonstrates how to use a MasterDetailPage and navigate between its pages of information.

Modal Pages

This sample demonstrates how to navigate to modal pages.

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.

NumericValidation Behavior

Xamarin.Forms behaviors are created in a class that derives from the Behavior, or Behavior<T> class. This sample demonstrates how to create and consume a Xamarin.Forms behavior.

NumericValidation Behavior with Style

Xamarin.Forms behaviors can be consumed by an explicit or implicit style. This sample demonstrates how to consume a Xamarin.Forms behavior with an explicit style.

PanGesture

This sample demonstrates using the PanGestureRecognizer class to implement dragging.

Passing Data

This sample demonstrates how to pass data between pages when navigating.

Phoneword

This sample demonstrates sharing C# code across platforms using Xamarin.Forms.

Phoneword Multiscreen

This sample demonstrates adding simple page navigation to the Phoneword app using Xamarin.Forms.

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.

Resource Dictionaries

This sample demonstrates creating and consuming a ResourceDictionary at the application, page, and control level.

ScaleAndRotate

Demonstrates how to scale and rotate Xamarin.Forms visual elements.

Shadow Effect

This sample demonstrates using CLR properties to pass parameters to an effect.

Shadow Effect with Runtime Parameter Change

This sample demonstrates using attached properties to pass parameters to an effect, and changing a parameter at runtime.

Shadow Platform-Specific

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

Simple Theme

This sample demonstrates using a ControlTemplate to theme a ContentPage and change the theme at runtime.

Simple Theme with Template Binding

This sample demonstrates using a ControlTemplate with a TemplateBinding to theme a ContentPage and change the theme at runtime.

Simple Theme with Template Binding and ViewModel

This sample demonstrates using a ControlTemplate with a TemplateBinding, that in turn binds to a ViewModel, to theme a ContentPage and change the theme at runtime.

SkiaSharp and Xamarin.Forms

A project showing SkiaSharp features in a Xamarin.Forms application.

Solitaire Encryption (Xamarin.Forms)

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

Subclassed Native Views

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

TabbedPage

This sample demonstrates how to use a TabbedPage to navigate through a collection of pages. The TabbedPage is constructed by assigning a collection to the ItemsSource property and assigning a DataTemplate to the ItemTemplate property to return pages for objects in the collection.

TabbedPage with NavigationPage

This sample demonstrates how embed a NavigationPage in a TabbedPage, in order to perform page navigation within a tab. The TabbedPage is constructed by populating it with a collection of child Page objects.

TapGesture

These samples demonstrate working with tap gestures using Xamarin Forms.

TipCalc

Based on the existing iOS and Android sample, but completely rewritten for Xamarin.Forms.

Todo

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

Todo Cognitive Services

This sample demonstrates how to use some of the Microsoft Cognitive Services APIs in a Xamarin.Forms application.

Todo DocumentDB

This sample demonstrates how to use the Microsoft Azure DocumentDB Client Library to integrate the Azure DocumentDB service into a Xamarin.Forms application.

Todo DocumentDB Auth

This sample demonstrates how to combine access control with partitioned collections, so that a user can only access their own DocumentDB documents in a Xamarin.Forms application.

TodoASMX

This sample demonstrates a Todo list application where the data is stored and accessed from an ASMX web service.

TodoAWS

This sample demonstrates a Todo list application where the data is stored and accessed from a SimpleDB service in Amazon Web Services.

TodoAWSAuth

This sample demonstrates a Todo list application where the data is stored and accessed from a SimpleDB service in Amazon Web Services, with authentication occuring with a Google login.

TodoAzure

This sample demonstrates a Todo list application where the data is stored and accessed from an Azure Mobile App instance.

TodoAzureAuth

This sample demonstrates a Todo list application where the data is stored, accessed, and authenticated from an Azure Mobile App instance.

TodoAzureAuthADB2CClientFlow

This sample demonstrates how to use Azure Active Directory B2C to provide a client-side authentication and authorization flow to an Azure Mobile Apps instance with Xamarin.Forms.

TodoAzureAuthADB2CServerFlow

This sample demonstrates how to use Azure Active Directory B2C to provide a server-side authentication and authorization flow to an Azure Mobile Apps instance with Xamarin.Forms.

TodoAzureAuthOfflineSync

This sample demonstrates synchronizing offline data in a Xamarin.Forms application to an Azure Mobile Apps instance.

TodoAzurePush

This sample demonstrates how to use Azure Notification Hubs to send push notifications from an Azure Mobile Apps instance to a Xamarin.Forms application.

TodoLocalized (Xamarin.Forms)

Demonstrates how to localize Xamarin.Forms using RESX.

TodoParse

This sample demonstrates a Todo list application where the data is stored and accessed from a Parse web service.

TodoParseAuth

This sample demonstrates a Todo list application where the data is stored, accessed, and authenticated from a Parse web service.

TodoREST

This sample demonstrates a Todo list application where the data is stored and accessed from a RESTful web service.

TodoWCF

This sample demonstrates a Todo list application where the data is stored and accessed from a WCF web service.

Touch-Tracking Effect Demos

This sample demonstrates an effect to trigger events for multi-touch finger tracking.

Validation Callback

A bindable property is a special type of property, where the property's value is tracked by the Xamarin.Forms property system. This sample demonstrates using a validation callback to validate the value of a bindable property.

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.

Xamarin Forms Image Resizer

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

Xamarin Insights with Xamarin.Forms

Xamarin Insights helps you report bugs and track users in your apps.

Xamarin.Forms Text

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

XAML Samples

A collection of samples that demonstrate how to utilize XAML with Xamarin.Forms.

Xuzzle

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