simplifies the code

vnext
Paul Schneider 8 years ago
parent bb30d0c665
commit 478149e383
1 changed files with 3 additions and 7 deletions

@ -1,9 +1,4 @@
using System; using Xamarin.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace BookAStar.Behaviors namespace BookAStar.Behaviors
{ {
@ -54,7 +49,7 @@ namespace BookAStar.Behaviors
private void bindable_TextChanged(object sender, TextChangedEventArgs e) private void bindable_TextChanged(object sender, TextChangedEventArgs e)
{ {
//if (MaxLength != null && MaxLength.HasValue) //if (MaxLength != null && MaxLength.HasValue)
if (e.NewTextValue.Length > 0 && e.NewTextValue.Length > MaxLength) if (e.NewTextValue.Length > MaxLength)
((Entry)sender).Text = e.NewTextValue.Substring(0, MaxLength); ((Entry)sender).Text = e.NewTextValue.Substring(0, MaxLength);
} }
@ -63,5 +58,6 @@ namespace BookAStar.Behaviors
bindable.TextChanged -= bindable_TextChanged; bindable.TextChanged -= bindable_TextChanged;
} }
} }
} }

Loading…