This is a migrated thread and some comments may be shown as answers.

[Solved] "Reduce XAP size..." option disables Right Click Context Menu and Spell Checker

2 Answers 218 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Don
Top achievements
Rank 1
Don asked on 19 Jul 2011, 10:58 AM
Why is it that when I check the "Reduce XAP size by using application library caching" option on a Silverlight 4 project, right-click Context Menus and Spell Checker inside the RadRichTextBox no longer work? To elaborate further, I've referenced Telerik.Windows.Documents.Proofing.Dictionaries.En-US.dll and when "Reduce XAP size by using application library caching" option is unchecked the dictionary is working. However, when I check that option, all words get underlined in red.

Is there a way to make this to work? Probably code behind or some workaround? In order to replicate ths problem do the following:
1. Create a VS2010 Silverlight 4.0 Navigation Project (Out-of-the-box).
2. Add a Telerik RichTextBox to the Home.xaml
3. When the Telerik dialog comes up select Word Processor and check all options except read-only.
4. Build and Run the project to see that it works.
5. Test the the "Reduce XAP size by using application library caching" option by checking the options and building and running it again.

P.S. We need to use the application library caching option because Telerik's libraries at this time are about 3MB and would probably grow larger when we use more of Telerik's libraries. This would cause performance issues if we download it always together with the XAP file.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Accepted
Iva Toteva
Telerik team
answered on 20 Jul 2011, 04:35 PM
Hi Don,

All additional UI components 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.
As a workaround you can manually instantiate them and  set the following properties:
// Next method calls are required only to work around limitations for using MEF
this.editor.FindReplaceDialog = newFindReplaceDialog();
this.editor.ParagraphPropertiesDialog = newRadParagraphPropertiesDialog();
this.editor.FontPropertiesDialog = newFontPropertiesDialog();
  
this.editor.InsertSymbolWindow = newRadInsertSymbolDialog();
this.editor.InsertHyperlinkDialog = newRadInsertHyperlinkDialog();
this.editor.ManageBookmarksDialog = newManageBookmarksDialog();
  
this.editor.ContextMenu = newContextMenu();
this.editor.SelectionMiniToolBar = newSelectionMiniToolBar();
this.editor.ImageMiniToolBar = newImageMiniToolBar();
  
this.editor.InsertTableDialog = newInsertTableDialog();
this.editor.TablePropertiesDialog = newTablePropertiesDialog();
this.editor.TableBordersDialog = newTableBordersDialog();
  
this.editor.SpellCheckingDialog = newSpellCheckingDialog();
this.editor.EditCustomDictionaryDialog = newEditCustomDictionaryDialog();
  
this.editor.ImageEditorDialog = newImageEditorDialog();
this.editor.FloatingBlockPropertiesDialog = newFloatingBlockPropertiesDialog();
  
this.editor.InsertDateTimeDialog = newInsertDateTimeDialog();
  
((DocumentSpellChecker)this.editor.SpellChecker).AddDictionary(newRadEn_USDictionary(), CultureInfo.InvariantCulture);

somewhere after InitizializeComponents in your constructor.
You can also check out Telerik Minifier to minimize the size of the assemblies you use and the size of the XAP. More information on it can be found in our online documentation.

Best wishes,
Iva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Don
Top achievements
Rank 1
answered on 21 Jul 2011, 06:33 AM
Thanks for the answer and the additional information on the minifier which helped a lot.
Tags
RichTextBox
Asked by
Don
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Don
Top achievements
Rank 1
Share this question
or