Return Type in Xamarin Numeric Entry (SfNumericTextBox)
16 Oct 2020 / 2 minutes to read
We can able to define the return key type of NumericTextBox by using the ReturnType
property of the type Xamarin.Forms ReturnType.
<syncfusion:SfNumericTextBox x:Name="numericTextBox" ReturnType= "Next" Value="123" />
SfNumericTextBox numericTextBox = new SfNumericTextBox();
numericTextBox.ReturnType = ReturnType.Next;
numericTextBox.Value = 123;
NOTE
Default value of
ReturnType
isDefault
.
Return Command
The ReturnCommand
property defines an ICommand
implementation that wraps an action when the user presses return button.
Return Command Parameter
The ReturnCommandParameter
property is used to set the parameter that is sent to the ReturnCommand
.
<ContentPage.BindingContext>
<local:ViewModel />
</ContentPage.BindingContext>
<syncfusion:SfNumericTextBox x:Name="numericTextBox" ReturnType="Next" Value="123" ReturnCommand="{Binding CommandProperty}" />
public class ViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged = delegate { };
public ICommand CommandProperty { protected set; get; }
public ViewModel()
{
CommandProperty = new Command(
execute: () =>
{
OnSubmit();
},
canExecute: () =>
{
return true;
});
}
private void OnSubmit()
{
}
}
See also
How to get the localized return key on the iOS keyboard in SfNumericTextBox
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page