Xamarin.Forms Guides | Samples

Xamarin.Forms.Cell Class

Provides base class and capabilities for all Forms cells. Cells are elements meant to be added to ListView or TableView.

See Also: Cell


public abstract class Cell : Element, ICellController


The subtypes of Cell are:

EntryCellA Cell with a label and a single line text entry field.
SwitchCellA Cell with a label and an on/off switch.
TextCellA Cell with primary and secondary text.
ImageCellA TextCell that also includes an image.
ViewCellA Cell containing a developer-defined View.

The various subclasses are shown in the following image:

C# Example

Content = new TableView
    Root = new TableRoot ("Table Title")
        new TableSection("Section 1 Title")
            new TextCell
                Text = "TextCell Text",
                Detail = "TextCell Detail"
            new ImageCell
                Text = "ImageCell Text",
                Detail = "ImageCell Detail",
                ImageSource = "http://xamarin.com/images/index/ide-xamarin-studio.png"
            new EntryCell
                Label = "EntryCell:",
                Placeholder = "default keyboard",
                Keyboard = Keyboard.Default
        new TableSection("Section 2 Title")
            new EntryCell
                Label = "Another EntryCell:",
                Placeholder = "phone keyboard",
                Keyboard = Keyboard.Telephone
            new SwitchCell
                Text = "SwitchCell:"
            new ViewCell
                View = new StackLayout
                    Orientation = StackOrientation.Horizontal,
                    Children = 
                        new Label
                            Text = "Custom Slider View:"
                        new Slider

XAML for Xamarin.Forms supports the following properties for the Cell class:


A list of MenuItem objects to display when the user performs the context action.


true or false, indicating whether the animation for ActivityIndicator is displayed.


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

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

See Also: Element

Protected Constructors

Initializes a new instance of the Cell class.

Public Fields

static readonly
IsEnabledPropertyBindableProperty. Identifies the IsEnabled bindable property.

Public Properties

ContextActionsIList<MenuItem>. Gets a list of menu items to display when the user performs the device-specific context gesture on the Cell.
HasContextActionsBoolean. Gets a value that indicates whether the cell has at least one menu item in its Cell.ContextActions list property.
HeightDouble. Gets or sets the height of the Cell.
IsEnabledBoolean. Gets or sets the IsEnabled state of the Cell. This is a bindable property.
RenderHeightDouble. Gets the height of the rendered cell on the device.

Public Methods

Immediately updates the cell's size.

Protected Methods

Invoked whenever an Cell.Appearing event occurs. Implement this method to add class handling for this event.
Event that is raised when the binding context is changed.
Invoked whenever an Cell.Disappearing event occurs. Implement this method to add class handling for this event.
Invoked whenever a long press is applied to the Cell.
Application developers can override this method to do actions when the cell's parent is set.
TApplication developers can override this method to do actions when the property named by propertyName is set.
Invoked whenever the Cell is Tapped.

Public Events

AppearingOccurs when the visual representation of the Cell is being added to the visual layout.
DisappearingOccurs when the visual representation of the Cell is being removed from the visual layout.
TappedOccurs when the Cell is Tapped.

Explicitly Implemented Interface Members