6 Answers, 1 is accepted


Depending on the implementation of the Submit functionality, you could create a command that invokes the desired functionality of RadSpellChecker. The control itself, however, cannot be directly invoked through XAML. When the users submit the form, you could use the AllAtOnce spellchecking mode and verify that the text is correct. In case there are still errors, you can show a popup and one of the spell check dialogs (using the Check() method) to the user so they can correct what is left. The actions of the user are not stored anywhere, though, and you can detect only if the spell checking has been canceled using the arguments of the SpellCheckingCompleted event of RadSpellChecker or if a word has been added or removed from the dictionary in use using the DataChanged event of DocumentSpellChecker:
IControlSpellChecker controlSpellchecker = ControlSpellCheckersManager.GetControlSpellChecker(
typeof
(TextBox));
DocumentSpellChecker documentSpellChecker = (DocumentSpellChecker) controlSpellchecker.SpellChecker;
documentSpellChecker.DataChanged += DocumentSpellChecker_DataChanged;
You are right that the OK button cannot be dismissed. I created a public item which you can use to vote for extending the functionalities of RadSpellChecker. One of the improvements logged there is to allow loading custom dialogs for the control, which would allow you to customize the behavior of the dialog as well.
Hope this information is helpful.
Regards,
Tanya
Progress Telerik

Tanya, I appreciate your prompt response! Just a couple of follow-up questions.
1 - Could you please request a modest enhancement to the RadSpellChecker control that adds a property to have it auto-dismiss once the user has gone through all the corrections (without cancelling it first)? This would seem to be a simple enhancement versus having the developer to customize a dialog box. However, I think allowing the dialog to be customized is still a good idea for more complex functionality.
2 - Since the Check() method takes a Content control as a parameter, I'm not sure it's a good idea for the view model to take in a control from the view. By any chance, do you have a sample of a behavior (such as one that might be on the Submit button or perhaps a property that sets up an event on the control to be checked) that might already put this functionality in place?
Thank you again!
After further review of your scenario and discussions within the team, we came to the conclusion that your requirement for skipping the "The spelling check is complete" state of the dialog is already logged as a bug report here:
SpellChecker: RadSpellChecker.WindowSettings.ShowAlertWhenSpellCheckingCompleted doesn't suppress all alerts in AllAtOnce scenario
The item contains a workaround, which completely replaces the default TextBox spell checker with custom one, showing the "fixed" dialog.
For the MVVM approach - we do not have such behavior implemented, but I think one possible approach would be to implement your custom attached property. When set to a specific TextBox (in XAML), it could register it in a special collection; then when the Submit command for your form is executed, it could execute the spell checking on all controls in the collection - it's not the cleanest approach, but there won't be a direct reference between the ViewModel and the View.
Regards,
Boby
Progress Telerik

Boby, I'll definitely check out that link.
By the way, you guys are awesome with your support on these forums. You've definitely gone beyond my expectations!
With much appreciation,
Bruce