What about using a SortedDictionary<string, uint>
to sort using a custom comparer?
Proposed code:
public static ReadOnlyDictionary<string, uint> GetWordCountDictionary(string stringToCount)
{
Dictionary<string, uint> wordDictionary = new Dictionary<string, uint>();
//Rest of the method here that is not relevant
// Custom comparer can be created to order differently, instead of `StringComparer.InvariantCultureIgnoreCase`
var sortedDictionary = new SortedDictionary<string, uint>(wordDictionary, StringComparer.InvariantCultureIgnoreCase);
var result = new ReadOnlyDictionary<string, uint>(sortedDictionary);
return result;
}