private void OnKeyUp(object sender, KeyRoutedEventArgs e) { if (e.Key == VirtualKey.Escape) { StationSelectionChanged?.Invoke(this, new StationSelectionChangedEventArgs(curStation)); e.Handled = true; } }
private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (args.ChosenSuggestion is Station station) { curStation = station; StationSelectionChanged?.Invoke(this, new StationSelectionChangedEventArgs(station)); } else if (!(curStation is null)) { if (string.Equals(args.QueryText, curStation.name)) { StationSelectionChanged?.Invoke(this, new StationSelectionChangedEventArgs(curStation)); } } }