Xamarin.Forms Guides | Samples

Xamarin.Forms.CarouselPage Class

A Page that users can swipe from side to side to display pages of content, like a gallery.

See Also: CarouselPage


public class CarouselPage : MultiPage<ContentPage>, IElementConfiguration<CarouselPage>


The CarouselPage provides a navigation experience that will feel natural and familiar to Windows Phone users. By using Device.OnPlatform, application developers can provide customized navigation on a per-platform basis. For example, an application developer could use a NavigationPage for Android and iOS, and use a CarouselPage on Windows Phone.

The following XAML example, when properly included and referenced in a Xamarin.Forms project, creates a CarouselPage that displays three simple ContentPage elements:

XAML Example

<?xml version="1.0" encoding="UTF-8"?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XamlExample1.MyPage">
            <Label Text="Red" />
            <BoxView Color="Red" VerticalOptions="FillAndExpand" />
            <Label Text="Green" />
            <BoxView Color="Green" VerticalOptions="FillAndExpand" />
            <Label Text="Blue" />
            <BoxView Color="Blue" VerticalOptions="FillAndExpand" />

The following C# example creates a CarouselPage that displays three simple ContentPage elements:

C# Example

List<ContentPage> pages = new List<ContentPage> (0);
Color[] colors = { Color.Red, Color.Green, Color.Blue };
foreach (Color c in colors) {
    pages.Add (new ContentPage { Content = new StackLayout {
            Children = {
                new Label { Text = c.ToString () },
                new BoxView {
                    Color = c,
                    VerticalOptions = LayoutOptions.FillAndExpand

MainPage = new CarouselPage {
    Children = { pages [0],
                 pages [1],
                 pages [2] }
Note: When embedding a CarouselPage into a MasterDetailPage.Detail, application developers should set MasterDetailPage.IsGestureEnabled to false to prevent gesture conflicts between the CarouselPage and MasterDetailPage.


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,

The members of Xamarin.Forms.CarouselPage are listed below.

See Also: Inherited members from Xamarin.Forms.MultiPage<Xamarin.Forms.ContentPage>

Public Constructors

Initializes a new instance of the CarouselPage class.

Public Methods

On<T>() : IPlatformElementConfiguration<T, CarouselPage>
Returns the platform-specific instance of this CarouselPage, on which a platform-specific method may be called.

Protected Methods

CreateDefault(Object) : ContentPage
Creates a default page, suitable for display in thisCarouselPage, for an object.