Skip to content

Commit

Permalink
Only open on focus
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Nielsen committed Oct 19, 2023
1 parent 2e6e6d9 commit 4495eaa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions SampleApp/AutoSuggestBoxSamples/Simple.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ private void Initialize()
countries = new StreamReader(s).ReadToEnd().Split('\n').Select(t => t.Trim()).ToList();
}
SuggestBox1.ItemsSource = countries;
SuggestBox1.IsSuggestionListOpen = true;
}

private void SuggestBox_TextChanged(object sender, AutoSuggestBoxTextChangedEventArgs e)
Expand All @@ -33,7 +32,7 @@ private void SuggestBox_TextChanged(object sender, AutoSuggestBoxTextChangedEven

private List<string> GetSuggestions(string text)
{
return string.IsNullOrWhiteSpace(text) ? null : countries.Where(s => s.StartsWith(text, StringComparison.InvariantCultureIgnoreCase)).ToList();
return string.IsNullOrWhiteSpace(text) ? countries : countries.Where(s => s.StartsWith(text, StringComparison.InvariantCultureIgnoreCase)).ToList();
}

private void SuggestBox_QuerySubmitted(object sender, AutoSuggestBoxQuerySubmittedEventArgs e)
Expand Down

0 comments on commit 4495eaa

Please sign in to comment.