Xamarin.Forms Guides | Samples

Xamarin.Forms.EntryCell Class

A Cell with a label and a single line text entry field.

See Also: EntryCell

Syntax

public class EntryCell : Cell, IEntryCellController

Remarks

The following example shows a basic use.

C# Example

using System;
using Xamarin.Forms;

namespace FormsGallery
{
    class EntryCellDemoPage : ContentPage
    {
        public EntryCellDemoPage()
        {
            Label header = new Label
            {
                Text = "EntryCell",
                FontSize = Device.GetNamedSize (NamedSize.Large, typeof(EntryCell)),
                HorizontalOptions = LayoutOptions.Center
            };

            TableView tableView = new TableView
            {
                Intent = TableIntent.Form,
                Root = new TableRoot
                {
                    new TableSection
                    {
                        new EntryCell
                        {
                            Label = "EntryCell:",
                            Placeholder = "Type Text Here"
                        }
                    }
                }
            };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            // Build the page.
            this.Content = new StackLayout
            {
                Children = 
                {
                    header,
                    tableView
                }
            };
        }
    }
}

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

PropertyValue
KeyboardA Keyboard property name that indicates which keyboard to present to the user when editing text.
Label

The text that is presented next to the entry area in the EntryCell.

LabelColor

A color specification, with or without the prefix, "Color". For example, "Color.Red" and "Red" both specify the color red.

PlaceholderThe default text that will appear in the control when it is empty.
Text

The initial text that will appear in the editor.

XAlign

Center, End, or Start, to indicate the placement of the text that is entered by the user.

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, 1.4.0.0, 1.5.0.0, 2.0.0.0

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

See Also: Cell

Public Constructors

Initializes a new instance of the EntryCell class.

Public Fields

static readonly
HorizontalTextAlignmentPropertyBindableProperty. Identifies the HorizontalTextAlignment bindable property.
static readonly
KeyboardPropertyBindableProperty. Identifies the Keyboard bindable property.
static readonly
LabelColorPropertyBindableProperty. Identifies the LabelColor bindable property.
static readonly
LabelPropertyBindableProperty. Identifies the Label bindable property.
static readonly
PlaceholderPropertyBindableProperty. Identifies the Placeholder bindable property,
static readonly
TextPropertyBindableProperty. Identifies the Text bindable property.
static readonly
XAlignPropertyBindableProperty. Identifies the XAlign bindable property.

Public Properties

HorizontalTextAlignmentTextAlignment. Gets or sets the horizontal alignement of the Text property. This is a bindable property.
KeyboardKeyboard. Gets or sets the Keyboard to display while editing the EntryCell. This is a bindable property.
LabelString. Gets or sets the fixed text presented next to the Entry in the EntryCell. This is a bindable property.
LabelColorColor. Gets or sets the Color used for rendering the Label property. This is a bindable property.
PlaceholderString. Gets or sets the placeholder text displayed in the Entry when the Text is null or empty. This is a bindable property.
TextString. Gets or sets the content of the Entry of the EntryCell. This is a bindable property.
XAlignTextAlignment. Gets or sets the horizontal alignement of the Text property. This is a bindable property.

Public Events

CompletedEvent fired when the user presses 'Done' on the EntryCell's keyboard

Explicitly Implemented Interface Members

EntryCell$IEntryCellController.SendCompletedThis interface is for internal use by platform renderers.