I want to create a few text box that only numeric values can be entered. The first number entered will be pushed to the front as more numbers are entered. Eg. (00.00) -> (00.01) -> (00.12) -> (01.23) -> (12.34) and deletion will be the opposite of this. Then using the numeric values entered, I can do some simple calculation and display the result. My current code doesn't do this, and it is hard to add and delete the values in the text box. Any solutions?
Xaml file:
<Frame Grid.Row="1" Style="{StaticResource FrameStyleBlack2}">
<OnPlatform x:TypeArguments="View">
<OnPlatform.Android>
<customstyle:EntryBorderless
Keyboard="Numeric"
Style="{StaticResource EntryStyle2}"
Text="{Binding Price1, StringFormat='{0:F2}'}">
<customstyle:EntryBorderless.Behaviors>
<xct:EventToCommandBehavior Command="{Binding BindingContext.Price1ChangedCommand}" EventName="TextChanged" />
</customstyle:EntryBorderless.Behaviors>
</customstyle:EntryBorderless>
</OnPlatform.Android>
</OnPlatform>
</Frame>
View Model:
double price1;
public double Price1
{
get
{
return price1;
}
set
{
price1 = value;
OnPropertyChanged(nameof(Price1));
}
}
public ICommand Price1ChangedCommand
{
get;
}