' page var
Private WithEvents mspellChecker As XamSpellChecker
' page load event
Dim spellBinding As New Binding() spellBinding.Mode = BindingMode.TwoWay Dim propPathSpellBinding As New PropertyPath("Text") spellBinding.Path = propPathSpellBinding spellBinding.Source = Me.narrative mspellChecker = New XamSpellChecker() mspellChecker.DictionaryUri = New Uri("Dictionaries/english-generic-whole.dict", UriKind.Relative) mspellChecker.SpellCheckTargets.Add(spellBinding) Me.LayoutRoot.Children.Add(mspellChecker) ' button click event Private Sub btnSpellCheck_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSpellCheck.Click Try mspellChecker.SpellCheckDialog.StartupPosition = StartupPosition.Manual mspellChecker.SpellCheckDialog.Top = 50 mspellChecker.SpellCheckDialog.Left = 50 mspellChecker.SpellCheck() Catch ex As Exception ErrorHandler(ex) End Try End Sub the dictionaries are in teh clientbin folder on the website with the xap file clientbin dictionaries xxxxx.xap
Dim spellBinding As New Binding() spellBinding.Mode = BindingMode.TwoWay Dim propPathSpellBinding As New PropertyPath("Text") spellBinding.Path = propPathSpellBinding spellBinding.Source = Me.narrative mspellChecker = New XamSpellChecker() mspellChecker.DictionaryUri = New Uri("Dictionaries/english-generic-whole.dict", UriKind.Relative) mspellChecker.SpellCheckTargets.Add(spellBinding) Me.LayoutRoot.Children.Add(mspellChecker)
' button click event
Private Sub btnSpellCheck_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSpellCheck.Click Try mspellChecker.SpellCheckDialog.StartupPosition = StartupPosition.Manual mspellChecker.SpellCheckDialog.Top = 50 mspellChecker.SpellCheckDialog.Left = 50 mspellChecker.SpellCheck() Catch ex As Exception ErrorHandler(ex) End Try End Sub the dictionaries are in teh clientbin folder on the website with the xap file clientbin dictionaries xxxxx.xap
Private Sub btnSpellCheck_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSpellCheck.Click Try mspellChecker.SpellCheckDialog.StartupPosition = StartupPosition.Manual mspellChecker.SpellCheckDialog.Top = 50 mspellChecker.SpellCheckDialog.Left = 50 mspellChecker.SpellCheck() Catch ex As Exception ErrorHandler(ex) End Try End Sub
the dictionaries are in teh clientbin folder on the website with the xap file
clientbin
dictionaries
xxxxx.xap
Hi,
this is most probably an issue with downloading the dictionaries. You could add an event handler to DictionaryDownloadCompleted event and check the e.Error argument to see if something's wrong with downloading the dictionary.
Hope this helps,
HI,
I am following up on this forum thread, please let me know if you require further assistance.
Sincerely Matt Developer Support Engineer
I can get to the dictionary file in my local dev enviroment but when uploaded to the server I can't get to the dictionary file. When I try to navigate to the dictionary file I get an HTTP Error 404.0 - Not Found. Where should the dictionary file go? root? clientbin?
The documentation instructs to put the dictionary in "<root>/ClientBin/Dictionaries/us-english-v2-whole.dict". This is the current setup I have and It works locally but not on dev server.
Create a directory in your ClientBin and place the dictionary in this directory. Here is a help link http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=SL_xamSpellChecker_Dictionaries.html
Sincerely, Matt Developer Support Engineer
What you suggest is what I currently have (as stated in my reply) and it's still not working.
the path to the .dict file should be relative to your Silverlight Application .xap file. In Dev environment, you place the dictionaries in your ClientBin folder because this is where the .xap file is being deployed when you build your solution.
When you deploy your .xap file on an IIS web site, you need to place the .dict files in such a way so the relative path is the same. So, you'll need to create a "Dictionaries" subfolder in the location where your .xap file is stored on the IIS server and place the dictionaries there.
When I created my Silverlight App I also created a ASPX App as well. When deploying I use VS's "Publish" option and delpoy to file system (sense I have remote access to the server and the wwwroot directory where the app will be published to is shared to me) then I manually copy the dictionary directory which contains all the dictionary files to the ClientBin where my xap file is. Am I doing something wrong?? Is there something extra that I must do in IIS on the dev server? Install mime types, handlers??
Any help would be appreciated.
I don't think you need something special to get this working.
Actually, I tried to reproduce your scenario by hosting the spellchecker on IIS web site on my local machine. When I used an absolute uri for the dictionary (http://localhost:8080/Dictionaries/xxx.dict). I had to add a MIME type for the .dict files extension in order to get this working. However, using relative uri (as you do in your code) worked without the need to add a mime type.
One easy workaround if you only use the english dictionary would be not to specify a dictionary uri at all. The spell-checker automatically uses the english dictionary if you do not explicitly set your own dictionary uri.
If this does not work for you, you could try using an absolute path to the dictionary (e.g., http://site.address:port/Dictionaries/dictionary.dict) and see if it's working. You might need to add a mime type for the .dict file extension (text/plain should be fine). You could also enable directory browsing for your web site and test browsing the Dictionaries folder in the browser to make sure the absolute uri you're using is valid. If it's working with absolute Uri's, it should also work with relative Uri's.