This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to change the order of the suggestions in an AutocompleteBox, since per default the suggestions are ordered alphabetically.
I've got an ObservableCollection<City> (a collection of all cities in Germany with more than 1000 inhabitants), which is ordered by "Size" and used as the SuggestionsSource of the AutocompleteBox. The user can't see the Size, but only the Name. The AutocompleteBox changes the order, however. I would like to show the suggestions sorted by Size, not by Name. For example, if the user types "Ber", the topmost suggestion should be "Berlin".
public class City
{
public City() { }
public City(int size, string name) { Size = size; Name = name; }
public int Size { get; set; }
public string Name { get; set; }
}
How can I change the sorting behaviour of the SuggestionsSource?
Thanks!
Simon