Skip to main content

DataFormDateItem.AutofillContentType Property

Gets or sets the hint that helps an autofill service determine how to populate the editor with user data.

Namespace: DevExpress.XamarinForms.DataForm

Assembly: DevExpress.XamarinForms.Editors.dll

NuGet Package: DevExpress.XamarinForms.Editors

Declaration

public DateAutofillContentType AutofillContentType { get; set; }

Property Value

Type Description
DateAutofillContentType

The hint that helps an autofill service determine how to populate the editor with user data.

Available values:

Name Description Android
None

Indicates that an autofill service cannot populate this editor.

AndroidBirthDate

Indicates that an autofill service can populate this editor with a full birth date.

AUTOFILL_HINT_BIRTH_DATE_FULL

AndroidCreditCardExpirationDate

Indicates that an autofill service can populate this editor with a credit card expiration date.

AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE

Remarks

If the item’s AutofillContentType property is set to AndroidBirthDate or AndroidCreditCardExpirationDate, the user can automatically fill the editor with an appropriate date. Note that the device should have an enabled autofill service that contains the required values (names, dates, passwords, and so on).

Example

The markup below contains a data form with the First Name, Last Name, Birth Date, and Phone editors. An autofill service can populate these editors with appropriate values. When the user taps an editor, it shows available values.

Use an editor’s AutofillContentType property to specify the hint that helps an autofill service determine how to populate the editor with user data.

Data Form Autofill

<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:dxdf="http://schemas.devexpress.com/xamarin/2014/forms/dataform"
    xmlns:dxe="http://schemas.devexpress.com/xamarin/2014/forms/editors">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <dxdf:DataFormView
            EditorLabelWidth="40"
            EditorLabelColor="#8a8d93"
            CommitMode="Manually"
            ValidationMode="LostFocus"
            DataObject="{Binding Model}"
            x:Name="dataForm"
            EditorBoxMode="Outlined"
            EditorHorizontalSpacing="10"
            ReserveBottomTextLine="True"
            Margin="0,0,10,0" >
            <dxdf:DataFormTextItem
                FieldName="FirstName"
                Placeholder="First name"
                RowOrder="0"
                LabelIcon="editors_name"
                AutofillContentType="GivenName"/>
            <dxdf:DataFormTextItem
                FieldName="LastName"
                Placeholder="Last name"
                RowOrder="1"
                LabelText=""
                IsLabelVisible="{Binding IsVertical}"
                AutofillContentType="FamilyName"/>
            <dxdf:DataFormDateItem
                FieldName="Birthday"
                Placeholder="Birthday"
                RowOrder="2"
                LabelIcon="editors_age"
                DisplayFormat="d" 
                AutofillContentType="AndroidBirthDate"/>
            <dxdf:DataFormMaskedItem
                FieldName="PhoneNumber"
                Placeholder="Phone number"
                RowOrder="3"
                LabelIcon="editors_phone"
                Keyboard="Telephone"
                Mask="+1 (000) 000-0000"
                IsLabelVisible="{Binding IsVertical}"
                AutofillContentType="PhoneNumber"/>
        </dxdf:DataFormView>
        <dxe:SimpleButton
            Grid.Row="1"
            VerticalOptions="EndAndExpand"
            TextColor="White"
            Padding="22"
            BackgroundColor="#2088ff"
            Text="SUBMIT"
            Clicked="Submit_OnClicked" />
    </Grid>
</ContentPage>
See Also