Home Search Member List Faq Register Login  
UltimateSpellSL
Re: RichTextBox in DataTemplate not working

Thread Starter: neiledwards   Started: 10-08-2014 1:42 AM   Replies: 4
 Karamasoft Support Forums » General Discussions » UltimateSpellSL » Re: RichTextBox in DataTemplate not working
 Printable Version    « Previous Thread   Next Thread »
  08 Oct 2014, 1:42 AM
neiledwards is not online. Last active: 10/20/2014 5:26:04 AM neiledwards

Not Ranked
Joined on 10-08-2014
Posts 4
RichTextBox in DataTemplate not working
I have a ListBox attached to an Observable collection that is using a DataTemplate that contains a RichTextBox. When I place the UnltimateSpellSL control on the page it will pick up and RichTextBox on the page but does not apply the spell checking to those in the ListBox.

The only way around this I have found is to create a composite control containing the UltimateSpellSL control and a RichTextBox. The problem is each instance of the UltimateSpellSL control uses about 25Mb of memory. So a 4 on the page (or in a list) uses 100Mb of memory! I can only assume it is downloading the dictionary and expanding it in to memory each time.

I need a way to have a single instance on the page and apply this to all RichTextBoxes in the visual tree regardless of where they are.

  
  08 Oct 2014, 10:31 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: RichTextBox in DataTemplate not working
We don't know how you found out UltimateSpellSL is using 25MB of memory but the dictionary and language files are retrieved as compressed files only once and their total size is less than 1MB as compressed.

You also don't need to add a separate UltimateSpellSL control for each RichTextBox. If you don't set the ControlIdsToCheckProperty, it should check spelling in all RichTextBox controls.

  
  08 Oct 2014, 1:39 PM
neiledwards is not online. Last active: 10/20/2014 5:26:04 AM neiledwards

Not Ranked
Joined on 10-08-2014
Posts 4
Re: RichTextBox in DataTemplate not working
I originally quoted the code here but it won't render correctly so this is a link to the test project I have been using.

https://onedrive.live.com/redir?resid=AD54F133E59D9751!2333&authkey=!ACB4srug4CxoNBk&ithint=file%2czip

I've done a very simple test by creating two pages (MainPage and MainPage2) and the only difference being one doesn't have the UltimateSpellSL component on and the other does. Watching task manager and without doing anything except load the page in IE10 the first page hovers between 34Mb and 38Mb and never goes over 40Mb the second between 51Mb and 53Mb but never drops below 50Mb. So an absolute minimum of 10Mb, but it's always closer to 15Mb. I've tried various numbers of RichTextBox and it makes very little difference.

My second issue is that the UltimateSpellSL control is not aware of RichTextBoxes in a DataTemplate. MainPage3 is an example page. This will make the first four RichTextBoxes have spell checking applied but the items in the listbox do not.

If I create a user control (RichTextSpellingControl) containing the UltimateSpellSL control and use this in the DataTemplate (MainPage4) this allows the items to be spell-checked but at a huge price. The difference between pages MainPage3 and MainPage4 is 55-57Mb and 140-145Mb. Which is approx about 5 x 15Mb which was my original finding for a single use of the control.

Would very much appreciate anyone's input in to this. We have used the listbox in a few places and are now seeing resource issues on user machines as a consequence. I'm not sure if this is because of using the AsYouType settings and if using the on demand button would make any difference. Something I will further investigate.

Thanks. N.


  
  09 Oct 2014, 7:09 AM
neiledwards is not online. Last active: 10/20/2014 5:26:04 AM neiledwards

Not Ranked
Joined on 10-08-2014
Posts 4
Re: RichTextBox in DataTemplate not working
Further investigations are that SpellAsYouType or ShowButton don't make any difference. What does seem to make a difference is the size of the dictionary. If I reduce the US dictionary to half it's size I get almost half the reduction in memory usage. I believe the control is expanding this dictionary in memory for lookup and this expansion is causing the usage. If I have many as in MainPage4 this obviously usages much more memory.
  
  20 Oct 2014, 5:26 AM
neiledwards is not online. Last active: 10/20/2014 5:26:04 AM neiledwards

Not Ranked
Joined on 10-08-2014
Posts 4
Re: RichTextBox in DataTemplate not working
Any thoughts from anyone appreciated? Even if that is to validate my findings.
  
 Page 1 of 1 (5 items)
Karamasoft Support Forums » General Discussions » UltimateSpellSL » Re: RichTextBox in DataTemplate not working

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.