I tried to improve the download size of XAP by changing project properties to "Reduce XAP size by using application library caching". Issue comes when we run the application it shows red underline (like spell check does) under every word. It may be because the dictionary is not getting loaded or something. Can you help
Regards\
Abhay
5 Answers, 1 is accepted
All additional UI components (dialogs, context menu, selection mini toolbar) and dictionaries are normally instantiated by MEF. If application library caching is turned on, when MEF tries to find types they are in the assemblies still on the server, thus they cannot be loaded. Thus the dialogs will not show and spell checker will underline every word.
As a workaround, you can manually create and set instance of the dictionary like this:
((DocumentSpellChecker)
this
.richTextBox.SpellChecker).AddDictionary(
new
RadEn_USDictionary(), CultureInfo.InvariantCulture);
This is what you need to get all dialogs working and the dictionary :
this
.editor.FindReplaceDialog = new
FindReplaceDialog();
this
.editor.ParagraphPropertiesDialog =
new
RadParagraphPropertiesDialog();
this
.editor.FontPropertiesDialog =
new
FontPropertiesDialog();
this
.editor.InsertSymbolWindow =
new
RadInsertSymbolDialog();
this
.editor.InsertHyperlinkDialog =
new
RadInsertHyperlinkDialog();
this
.editor.ContextMenu =
new
ContextMenu();
this
.editor.SelectionMiniToolBar =
new
SelectionMiniToolBar();
this
.editor.InsertTableDialog =
new
InsertTableDialog();
this
.editor.TablePropertiesDialog =
new
TablePropertiesDialog();
this
.editor.TableBordersDialog =
new
TableBordersDialog();
this
.editor.SpellCheckingDialog =
new
SpellCheckingDialog();
((DocumentSpellChecker)
this
.editor.SpellChecker).AddDictionary(
new
RadEn_USDictionary(), CultureInfo.InvariantCulture);
Don't hesitate to contact us if you have other questions.
All the best,
Boby
the Telerik team
The assembly containing the default En-Us dictionary is about 900 KB when compressed in the XAP file. You could also prepare assemblies containing your own custom dictionaries, as described here.
Don't hesitate to contact us if you have other questions.
All the best,Boby
the Telerik team
this.txtDescription.SpellCheckingDialog = new SpellCheckingDialog();
((
DocumentSpellChecker)this.txtDescription.SpellChecker).AddDictionary(new RadEn_USDictionary(), CultureInfo.InvariantCulture);
This does not recognize "wouldn't" until I add it. Now i have read that it does not immediately recognize contractions - not on the copy paste I get that one.
Iissue one: I would like add some of the common contractions to the dictionary as well as industry specific words. The issue is if I add them will all my users see those changes or is all the users have independant copies of the dictionary somewhere?
Issue two:
How do I find this dictionary and can it be edited directly or do I have to create a UI for it? I simply could just put all of my words into my application and individually add them but would all of my users see these changes or would be restricted to me?
I see people referencing a TDF file but I can find it no where - is this what I should create and how would that work because I'm assuming I want to inherit the base dictionary content.
Could I use the MSFT word dictionary? And how?
This silverlight app is being hosted in SPS2010 if that makes a difference.
Paul
RadRichTextBox uses .tdf files for storing the words for a given language and creating RadDictionary instances. For the time being no other formats than .tdf can be used. You can find a lot of available .tdf dictionaries here. You can read how to create dictionaries different from the one included in our suite here.
In your case it would be best to edit the default en-US.tdf file and create a class inheriting from RadDictionary which loads the edited .tdf file. Thus all your clients will be using it and the words you have added will be used on every client.
On the other hand, you can't edit the dictionary you have loaded when your application is running. RadRichTextBox uses Custom dictionaries when a user wants a specific word to not be considered erroneous. These added words are included in the isolated storage by default.
The word "wouldn't" is already added in the en-US.tdf file so you don't have to do that.
Andrew
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>