While I already had the answer, it seemed to me that I would talk a little more about the use in XAML.
Unlike code, you cannot create a new instance of the Keyboard class to be used, but there is a way. I hope you have already xaml-ified your App.cs (uninstall it and create App.xaml and App.xaml.cs), so you donβt need to check if the Resources property has been initialized.
The next step is to override the OnStart () method and add the appropriate entries for the different keyboards that you use. I usually use three keyboards: numeric, electronic and text. Another useful is the Url keyboard, but you can add it in the same way.
protected override void OnStart() { base.OnStart(); this.Resources.Add("KeyboardEmail", Keyboard.Email); this.Resources.Add("KeyboardText", Keyboard.Text); this.Resources.Add("KeyboardNumeric", Keyboard.Numeric); }
This little code will make the keyboard accessible as static resources. To use them in XAML, follow these steps:
<Entry x:Name="emailEntry" Text="{Binding EMail}" Keyboard="{StaticResource KeyboardEmail}" />
And now, your entry now has an email.
source share