I am a newbie and I am building an app with Xamarin Forms where I save and get the data with asp.net Web API using EF6.

My system is in German, so the decimal sign is a ",". And here comes my Problem:

I have got an bound entry field "height":

XAML:

<Entry Placeholder="{helper:Translate Height}" Text="{Binding Height,Mode=TwoWay}" Keyboard="Numeric" Style="{StaticResource entryStyle}" > <Entry.Behaviors> <Behaviors:NumericEntry Double="True"/> </Entry.Behaviors> </Entry>

Model:

public class ProfileData : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(propertyName))); } . . . private double? _height; public double? Height { get => _height; set { _height = value; OnPropertyChanged(); } } . . . }

The binding works, but if I enter into the field a value like 175,2 and put a breakpoint on the setter in the model, there is a value of 1752....which gets saved like this into the DB (float column). If I enter a value like 175.2 its gets into the DB as 175,2 (notice the different Decimal Symbols). So if I get the values back from the DB, there will be 175,2 in my entry field, which, if I save again, turns like above into 1752.

Is this a problem of Culture Info? I tried for example to play with TryParse and changing the Culture Info in app.xaml.cs. but then my Weekdays get English too and the date format gets changed, which I don't want.

Could this also be a problem of the Web API and JSON?

I hope I do not have to (since I think this can't be the right solution) do something like .replace(",",".") or similar everywhere.

Edit

The Behavior I am using comes from here: https://github.com/xamarinhq/xamu-infrastructure/blob/master/src/XamU.Infrastructure/Behaviors/NumericValidationBehavior.cs