Quick Start Tutorial: Creating Universal Apps Via Xamarin: Entry Control - Part Six

Read the previous parts of the series here,

  1. Quick Start Tutorial: Creating Universal Apps Via Xamarin - Part One
  2. Quick Start Tutorial: Creating Universal Apps Via Xamarin - Part Two
  3. Quick Start Tutorial: Creating Universal Apps via Xamarin: Label and Button - Part Three
  4. Quick Start Tutorial: Creating Universal Apps Via Xamarin: Device class - Part Four
  5. Quick Start Tutorial: Creating Universal Apps via Xamarin: Device Class (cont.) - Part Five

This article explains about the entry control and editor control.

Entry Control (Text box control)

Entry control is a text box control and gets the input from the user. It supports a single line of the text.

code

output

Properties

Text Assign shows default value of the Text box.

Keyboard properties are used to force the user to show the specific keyboard.

Type of keyboards

Type

Ex: Telephone Keyboard

Telephone Keyboard

IsPassword property: Enable password character.

Placeholder

This property is like a label control, that highlights to the user what to enter in the text box

PlaceholderColor is a property, used to overwrite the default color of the placeholder text.

Placeholder

HorizontalTextAlignment

This is the property used to align the text based on the alignment; if the user types the character, the text is placed, and the default option is start.
HorizontalTextAlignment
Handling Events in Entry control

Two events are supported by Entry control,

  1. TextChanged
  2. Completed

TextChanged Event- Whenever the data enters into the entry box, the event will be triggered. 

Completed Event -When the user hits the enter key, this event will be triggered.


Xaml Code

Xaml Code

The code behind the handling event is shown below:

event
event

Editor

Editor control allows you to enter the multiple lines of text.


Note Editor controls do not contain the Placeholder property.

property
Create Keyboard

This is the method which provides enable or disable to some of the keyboard options like spelling checks, suggestions, and an automatic capitalization.

code

The arguments in the KeyboardFlags are:

KeyboardFlags

KeyboardFlags helps to capitalize the sentence. This option capitalizes the first words of the sentences. The spellcheck is supported to perform the spellcheck on the text which the user enters. The suggestions offered are the suggested word completions on the text which the user enters and it supports all the options.

Example: Typing the letters, suggestions of the words are displayed on top of the keyboard.
code
output

Completed Event

It is comprised of the multiple lines of the text control. Press enter to go to the next line. It will not fire the completed event as this event trigger will only control out of the focus, or press the back key.

code

code


Similar Articles