Read the previous parts of the series here,
- Quick Start Tutorial: Creating Universal Apps Via Xamarin - Part One
- Quick Start Tutorial: Creating Universal Apps Via Xamarin - Part Two
- Quick Start Tutorial: Creating Universal Apps via Xamarin: Label and Button - Part Three
- Quick Start Tutorial: Creating Universal Apps Via Xamarin: Device class - Part Four
- 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.
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
Ex: 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.
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.
Handling Events in Entry control
Two events are supported by Entry control,
- TextChanged
- 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
The code behind the handling event is shown below:
Editor
Editor control allows you to enter the multiple lines of text.
Note Editor controls do not contain the Placeholder 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.
The arguments in the KeyboardFlags are:
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.
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.