From f69dbf732e99b50d08706533807c6c6cd77a9ea7 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 9 Oct 2016 15:11:21 +0200 Subject: [PATCH] fixes decimal --- BookAStar/BookAStar/Behaviors/DecimalValidatorBehavior.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BookAStar/BookAStar/Behaviors/DecimalValidatorBehavior.cs b/BookAStar/BookAStar/Behaviors/DecimalValidatorBehavior.cs index c9b48923..aa7206eb 100644 --- a/BookAStar/BookAStar/Behaviors/DecimalValidatorBehavior.cs +++ b/BookAStar/BookAStar/Behaviors/DecimalValidatorBehavior.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -29,9 +30,8 @@ namespace BookAStar.Behaviors private void bindable_TextChanged(object sender, TextChangedEventArgs e) { decimal result; - IsValid = decimal.TryParse(e.NewTextValue, out result); + IsValid = decimal.TryParse(e.NewTextValue, NumberStyles.Currency,CultureInfo.InvariantCulture, out result); ((Entry)sender).TextColor = IsValid ? Color.Default : Color.Red; - } protected override void OnDetachingFrom(Entry bindable)