private static int LexiographicSuggestionBoxSorter(SuggestionBoxItem item1, SuggestionBoxItem item2)
 {
     return item1.DisplayText.CompareTo(item2.DisplayText);
 }
        private int RelevanceSorter(SuggestionBoxItem item1, SuggestionBoxItem item2)
        {
            //First sort what matches the prefix, then lexiographically
            if (item1.DisplayText.ToLower().StartsWith(rebuildingData.matchText))
            {
                if (!item2.DisplayText.ToLower().StartsWith(rebuildingData.matchText))
                    return -1;
            }
            else
            {
                if (item2.DisplayText.ToLower().StartsWith(rebuildingData.matchText))
                    return 1;
            }

            //Then sort on match case
            if (item1.DisplayText.StartsWith(rebuildingData.caseSensitiveMatchText))
            {
                if (!item2.DisplayText.StartsWith(rebuildingData.caseSensitiveMatchText))
                    return -1;
            }
            else
            {
                if (item2.DisplayText.StartsWith(rebuildingData.caseSensitiveMatchText))
                    return 1;
            }

            //Next, sort on shortest
            if (item1.DisplayText.Length < item2.DisplayText.Length)
                return -1;
            if (item1.DisplayText.Length > item2.DisplayText.Length)
                return 1;

            //Sort the rest alphabetically
            int cmp = item1.DisplayText.CompareTo(item2.DisplayText);
            if (cmp != 0)
                return cmp;
            //If two are the same, ensure some order is consistently chosen
            return item1.Signature.CompareTo(item2.Signature);
        }