Xamarin.Forms Guides | Samples

Xamarin.Forms.KeyboardTypeConverter Class

A TypeConverter that converts a string into a Keyboard.

See Also: KeyboardTypeConverter

Syntax

public class KeyboardTypeConverter : TypeConverter

Remarks

The following XAML snippet illustrates a case where a KeyboardTypeConverter is used behind the scenes:

XAML Example

<Entry Keyboard="Keyboard.Telephone" />

The following shows some examples of KeyboardTypeConverter forms:

C# Example

var converter = new KeyboardTypeConverter ();
foreach (var kvp in new Dictionary<string, Keyboard> {
	{"Keyboard.Default", Keyboard.Default},
	{"Keyboard.Email", Keyboard.Email},
	{"Keyboard.Text", Keyboard.Text},
	{"Keyboard.Url", Keyboard.Url},
	{"Keyboard.Telephone", Keyboard.Telephone},
	{"Keyboard.Chat", Keyboard.Chat},
})
Assert.AreSame (kvp.Value, converter.ConvertFrom (kvp.Key));

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.KeyboardTypeConverter are listed below.

See Also: TypeConverter

Public Constructors

Initializes a new instance of the KayboardTypeConverter class.

Public Methods

override
CanConvertFrom(Type) : Boolean
Returns wheher this converter can convert an object of the given type.
override
ConvertFrom(CultureInfo, Object) : Object
TConvert the given value into a Keyboard.
override
ConvertFromInvariantString(String) : Object
Returns a keyboard for a valid keyboard name.