private void SearchBarControl_TextChanged(object sender, TextChangedEventArgs e) { if (!string.IsNullOrEmpty(e.get_NewTextValue()) || this.get_SearchCommand() == null || !this.get_SearchCommand().CanExecute(this.get_SearchCommandParameter())) { return; } this.get_SearchCommand().Execute((object)e.get_NewTextValue()); }
private void Entry_TextChanged(object sender, TextChangedEventArgs e) { this.IsValid = false; float result = 0.0f; if (float.TryParse(e.get_NewTextValue(), out result)) { this.IsValid = (double)result > 1.0 && (double)result <= 5.0; } ((Entry)sender).set_TextColor(this.IsValid ? Color.get_Default() : (Color)Color.Red); }