MainDictionary
The main dictionary is a read-only, compressed word list that typically contains a few hundred thousand words. The main dictionary is typically loaded when the application starts, using the LoadAsyncmethod as illustrated below:
public Page()
{
InitializeComponent();
// Other initialization...
// Load main dictionary
SpellDictionary md = c1SpellChecker1.MainDictionary;
md.LoadCompleted += md_LoadCompleted;
md.LoadProgressChanged += md_LoadProgressChanged;
md.LoadAsync("C1Spell_en-US.dct");
}
The LoadAsyncmethod takes as a single parameter the URL of the spell dictionary, which is typically deployed as part of the application. The example above loads the C1Spell_en-US.dct which is the US English spell dictionary that ships with SpellChecker for Silverlight. This dictionary contains about 120,000 words and is about 250k bytes in size.
The LoadAsyncmethod loads the main dictionary asynchronously, so your application can start while the dictionary is downloaded from the server. When the download is complete, the C1SpellChecker component fires the LoadCompleted method which you can use to determine that the C1SpellChecker component is ready for work.
You can use the MainDictionary.State property to check at any time whether the main dictionary has been successfully loaded.
You can also load the main dictionary from a Stream object, so you can customize the loading process if you want.