Class SpellChecker
Provides real-time spell checking functionality to a SfRichTextBoxAdv control.
Inheritance
Namespace: Syncfusion.UI.Xaml.RichTextBoxAdv
Assembly: Syncfusion.SfRichTextBoxAdv.UWP.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 |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the CustomDictionaries dependency property. |
DictionariesProperty
Identifies the Dictionaries dependency property.
Declaration
public static readonly DependencyProperty DictionariesProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the Dictionaries dependency property. |
ErrorUnderlineTypeProperty
Identifies the ErrorUnderlineType dependency property.
Declaration
public static readonly DependencyProperty ErrorUnderlineTypeProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the ErrorUnderlineType dependency property. |
IgnoreAlphaNumericWordsProperty
Identifies the IgnoreAlphaNumericWords dependency property.
Declaration
public static readonly DependencyProperty IgnoreAlphaNumericWordsProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the IgnoreAlphaNumericWords dependency property. |
IgnoreUppercaseWordsProperty
Identifies the IgnoreUppercaseWords dependency property.
Declaration
public static readonly DependencyProperty IgnoreUppercaseWordsProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the IgnoreUppercaseWords dependency property. |
IgnoreURIsProperty
Identifies the IgnoreURIs dependency property.
Declaration
public static readonly DependencyProperty IgnoreURIsProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the IgnoreURIs dependency property. |
IsEnabledProperty
Identifies the IsEnabled dependency property.
Declaration
public static readonly DependencyProperty IsEnabledProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty | The identifier for the IsEnabled 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. |
ErrorUnderlineType
Gets or Sets the style of underline for highlighting spelling errors.
Declaration
public ErrorUnderlineType ErrorUnderlineType { get; set; }
Property Value
Type | Description |
---|---|
ErrorUnderlineType | The ErrorUnderlineType style. Default value is |
Examples
The following code example demonstrates how to change the error underline style in a SfRichTextBoxAdv control.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" Grid.Row="2" ManipulationMode="All" AcceptsTab="True" LayoutType="Pages" >
<RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
<!--Customize the error underline type-->
<RichTextBoxAdv:SpellChecker IsEnabled = "False" ErrorUnderlineType="Dashed" />
</RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv>
// Defines the control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
// Enables the spell checking functionality.
SpellChecker spellChecker = new SpellChecker();
spellChecker.IsEnabled = true;
//Change the error underline style to dashed.
spellChecker.ErrorUnderlineType = ErrorUnderlineType.Dashed;
richTextBoxAdv.SpellChecker = spellChecker;
' Defines the control.
Dim richTextBoxAdv As New SfRichTextBoxAdv()
' Enables the spell checking functionality.
Dim spellChecker As New SpellChecker()
spellChecker.IsEnabled = True
'Change the error underline style to dashed.
spellChecker.ErrorUnderlineType = ErrorUnderlineType.Dashed
richTextBoxAdv.SpellChecker = spellChecker
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 |
|
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