Class SpellChecker
Provides real-time spell checking functionality to a SfRichTextBoxAdv control.
Inheritance
Namespace: Syncfusion.Windows.Controls.RichTextBoxAdv
Assembly: Syncfusion.SfRichTextBoxAdv.WPF.dll
Syntax
public sealed class SpellChecker : DependencyObject
Examples
The following code example demonstrates how to enable spell checking functionality in a SfRichTextBoxAdv control.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:RichTextBoxAdv="clr-namespace:Syncfusion.Windows.Controls.RichTextBoxAdv;assembly=Syncfusion.SfRichTextBoxAdv.Wpf">
<RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
<!-- Enables spell checking functionality. -->
<RichTextBoxAdv:SpellChecker IsEnabled="True" IgnoreAlphaNumericWords="True" IgnoreURIs="True" IgnoreUppercaseWords="False">
<RichTextBoxAdv:SpellChecker.CustomDictionaries>
<!-- Defines the custom dictionaries for spell checking. -->
<System:String>../../Assets/Default.dic</System:String>
</RichTextBoxAdv:SpellChecker.CustomDictionaries>
</RichTextBoxAdv:SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv>
// Defines the control.
Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv richTextBoxAdv = new Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv();
// Enables the spell checking functionality.
SpellChecker spellChecker = new SpellChecker();
spellChecker.IsEnabled = true;
spellChecker.IgnoreAlphaNumericWords = true;
spellChecker.IgnoreURIs = true;
spellChecker.IgnoreUppercaseWords = false;
// Defines the custom dictionaries for spell checking.
spellChecker.CustomDictionaries.Add("../../Assets/Default.dic");
richTextBoxAdv.SpellChecker = spellChecker;
' Defines the control.
Dim richTextBoxAdv As New Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv()
' Enables the spell checking functionality.
Dim spellChecker As New SpellChecker()
spellChecker.IsEnabled = True
spellChecker.IgnoreAlphaNumericWords = True
spellChecker.IgnoreURIs = True
spellChecker.IgnoreUppercaseWords = False
' Defines the custom dictionaries for spell checking.
spellChecker.CustomDictionaries.Add("../../Assets/Default.dic")
richTextBoxAdv.SpellChecker = spellChecker
Constructors
SpellChecker()
Initializes a new instance of the SpellChecker class.
Declaration
public SpellChecker()
Fields
CustomDictionariesProperty
Identifies the CustomDictionaries dependency property.
Declaration
public static readonly DependencyProperty CustomDictionariesProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the CustomDictionaries dependency property. |
DictionariesProperty
Identifies the Dictionaries dependency property.
Declaration
public static readonly DependencyProperty DictionariesProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the Dictionaries dependency property. |
IgnoreAlphaNumericWordsProperty
Identifies the IgnoreAlphaNumericWords dependency property.
Declaration
public static readonly DependencyProperty IgnoreAlphaNumericWordsProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the IgnoreAlphaNumericWords dependency property. |
IgnoreUppercaseWordsProperty
Identifies the IgnoreUppercaseWords dependency property.
Declaration
public static readonly DependencyProperty IgnoreUppercaseWordsProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the IgnoreUppercaseWords dependency property. |
IgnoreURIsProperty
Identifies the IgnoreURIs dependency property.
Declaration
public static readonly DependencyProperty IgnoreURIsProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the IgnoreURIs dependency property. |
IsEnabledProperty
Identifies the IsEnabled dependency property.
Declaration
public static readonly DependencyProperty IsEnabledProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the IsEnabled dependency property. |
UseFrameworkSpellCheckProperty
Identifies the UseFrameworkSpellCheck dependency property.
Declaration
public static readonly DependencyProperty UseFrameworkSpellCheckProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | The identifier for the UseFrameworkSpellCheck dependency property. |
Properties
CustomDictionaries
Gets the collection of dictionary file locations that are used for custom spell checking.
Declaration
public ObservableCollection<string> CustomDictionaries { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<System.String> | The collection of dictionary file locations. |
Dictionaries
Gets the collection of dictionary file location that are used for custom spell checker of SfRichTextBoxAdv control.
Declaration
public ObservableCollection<string> Dictionaries { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<System.String> | The collection of dictionary file locations. |
Remarks
This collection is valid only when “UseFrameworkSpellCheck” is false.
IgnoreAlphaNumericWords
Gets or sets a value that determines whether to ignore alpha numeric words while spell checking in a SfRichTextBoxAdv control.
Declaration
public bool IgnoreAlphaNumericWords { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IgnoreUppercaseWords
Gets or sets a value that determines whether to ignore upper case words while spell checking in a SfRichTextBoxAdv control.
Declaration
public bool IgnoreUppercaseWords { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IgnoreURIs
Gets or sets a value that determines whether to ignore URIs while spell checking in a SfRichTextBoxAdv control.
Declaration
public bool IgnoreURIs { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsEnabled
Gets or sets a value that determines whether the spelling checker is enabled on a SfRichTextBoxAdv control.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
UseFrameworkSpellCheck
Gets or sets a value that determines whether to use framework built-in spell checker in SfRichTextBoxAdv control. Default value is True
.
Declaration
public bool UseFrameworkSpellCheck { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | If |
Remarks
Microsoft built-in spell checker is supported only when WPF provides a default dictionary. It provides dictionaries only for English, French, German, and Spanish languages. So, add custom dictionaries for other languages or use custom spell checker of SfRichTextBoxAdv control by setting “UseFrameworkSpellCheck” property as false.
Methods
CheckSpelling()
Checks the spellings mistakes in a SfRichTextBoxAdv control.
Declaration
public void CheckSpelling()
Examples
The following code example demonstrates how to check spelling mistakes in a SfRichTextBoxAdv control.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:RichTextBoxAdv="clr-namespace:Syncfusion.Windows.Controls.RichTextBoxAdv;assembly=Syncfusion.SfRichTextBoxAdv.Wpf">
<RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
<!-- Enables spell checking functionality. -->
<RichTextBoxAdv:SpellChecker IsEnabled="True" IgnoreAlphaNumericWords="True" IgnoreURIs="True" IgnoreUppercaseWords="False">
<RichTextBoxAdv:SpellChecker.CustomDictionaries>
<!-- Defines the custom dictionaries for spell checking. -->
<System:String>../../Assets/Default.dic</System:String>
</RichTextBoxAdv:SpellChecker.CustomDictionaries>
</RichTextBoxAdv:SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv>
public void CheckSpelling()
{
if (richTextBoxAdv.SpellChecker != null && richTextBoxAdv.SpellChecker.IsEnabled)
richTextBoxAdv.SpellChecker.CheckSpelling();
}
Public Sub CheckSpelling()
If richTextBoxAdv.SpellChecker IsNot Nothing AndAlso richTextBoxAdv.SpellChecker.IsEnabled Then
richTextBoxAdv.SpellChecker.CheckSpelling()
End If
End Sub