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

See Also: Cell Members

Syntax

public abstract class Cell : Element

Remarks

The subtypes of Xamarin.Forms.Cell are:

TypeDescription
EntryCellA Xamarin.Forms.Cell with a label and a single line text entry field.
SwitchCellA Xamarin.Forms.Cell with a label and an on/off switch.
TextCellA Xamarin.Forms.Cell with primary and secondary text.
ImageCellA Xamarin.Forms.TextCell that also includes an image.
ViewCellA Xamarin.Forms.Cell containing a developer-defined Xamarin.Forms.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
                        {
                        }
                    }
                }
            }
        }
    }
}          
          

The Xamarin.Forms.Cell class has the following XAML properties:

PropertyValue
ContextActions

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

IsEnabled

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

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0