Class SfSmartTextEditor
Initializes a new instance of the SfSmartTextEditor class that represents a control, used to providing auto-suggestions for text input.
Implements
Inherited Members
Namespace: Syncfusion.Maui.SmartComponents
Assembly: Syncfusion.Maui.SmartComponents.dll
Syntax
public class SfSmartTextEditor : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IKeyboardListener, IParentThemeElement, IThemeElement
Constructors
SfSmartTextEditor()
Initializes a new instance of the SfSmartTextEditor class.
Declaration
public SfSmartTextEditor()
Fields
MaxLengthProperty
Identifies the MaxLength dependency property.
Declaration
public static readonly BindableProperty MaxLengthProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for MaxLength dependency property. |
PlaceholderColorProperty
Identifies the PlaceholderColor dependency property.
Declaration
public static readonly BindableProperty PlaceholderColorProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for PlaceholderColor dependency property. |
PlaceholderProperty
Identifies the Placeholder dependency property.
Declaration
public static readonly BindableProperty PlaceholderProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for Placeholder dependency property. |
SuggestionDisplayModeProperty
Identifies the SuggestionDisplayMode dependency property.
Declaration
public static readonly BindableProperty SuggestionDisplayModeProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for SuggestionDisplayMode dependency property. |
SuggestionPopupBackgroundProperty
Identifies the SuggestionPopupBackground dependency property.
Declaration
public static readonly BindableProperty SuggestionPopupBackgroundProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for SuggestionPopupBackground dependency property. |
SuggestionTextColorProperty
Identifies the SuggestionTextColor dependency property.
Declaration
public static readonly BindableProperty SuggestionTextColorProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for SuggestionTextColor dependency property. |
TextChangedCommandProperty
Identifies the TextChangedCommand dependency property.
Declaration
public static readonly BindableProperty TextChangedCommandProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for TextChangedCommand dependency property. |
TextProperty
Identifies the Text dependency property.
Declaration
public static readonly BindableProperty TextProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for Text dependency property. |
TextStyleProperty
Identifies the TextStyle dependency property.
Declaration
public static readonly BindableProperty TextStyleProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for TextStyle dependency property. |
UserPhrasesProperty
Identifies the UserPhrases dependency property.
Declaration
public static readonly BindableProperty UserPhrasesProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for UserPhrases dependency property. |
UserRoleProperty
Identifies the UserRole dependency property.
Declaration
public static readonly BindableProperty UserRoleProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for UserRole dependency property. |
Properties
MaxLength
Gets or sets the maximum number of characters in the text editor.
Declaration
public int MaxLength { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The default value of MaxLength is int.MaxValue. |
Examples
The following code demonstrates, how to use the MaxLength property in the smart text editor.
Placeholder
Gets or sets the placeholder text displayed when the control is empty.
Declaration
public string Placeholder { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value of Placeholder is string.Empty. |
Examples
The following code demonstrates, how to use the Placeholder property in the smart text editor.
PlaceholderColor
Gets or sets the color of the placeholder text.
Declaration
public Color PlaceholderColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Graphics.Color | The default value of PlaceholderColor is Color.FromArgb("#49454F"). |
Examples
The following code demonstrates, how to use the PlaceholderColor property in the smart text editor.
SuggestionDisplayMode
Gets or sets to indicate whether suggestions should be displayed in an inline or popup.
Declaration
public SuggestionDisplayMode SuggestionDisplayMode { get; set; }
Property Value
| Type | Description |
|---|---|
| SuggestionDisplayMode | The default value of SuggestionDisplayMode is dependent on platform. For, Window and Mac catalyst is Inline, and Android and IOS is Popup. |
Remarks
In android and ios, for inline suggestion mode is not supported to apply suggestion on pressing the tab key.
Examples
The following code demonstrates, how to use the SuggestionDisplayMode property in the smart text editor.
SuggestionPopupBackground
Gets or sets the background for suggestion popup.
Declaration
public Brush SuggestionPopupBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.Brush | The default value of SuggestionPopupBackground is SolidColorBrush(Color.FromArgb("#F7F2FB")). |
Examples
The following code demonstrates, how to use the SuggestionPopupBackground property in the smart text editor.
SuggestionTextColor
Gets or sets the color of suggestion text.
Declaration
public Color SuggestionTextColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Graphics.Color | The default value of SuggestionTextColor is Color.FromArgb("#611c1b1f"). |
Examples
The following code demonstrates, how to use the SuggestionTextColor property in the smart text editor.
Text
Gets or sets the text content of the smart text editor.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value of Text is string.Empty. |
Examples
The following code demonstrates, how to use the Text property in the smart text editor.
TextChangedCommand
Gets or sets the smart text editor text changed command.
Declaration
public ICommand TextChangedCommand { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Input.ICommand | The default value of TextChangedCommand is null. |
Examples
The following code demonstrates, how to use the TextChangedCommand property in the smart text editor.
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<ste:SfSmartTextEditor x:Name="ste"
TextChangedCommand="{Binding TextCommand}">
</ste:SfSmartTextEditor>
TextStyle
Gets or sets the style applied to the input text.
Declaration
public SmartTextEditorStyle TextStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| SmartTextEditorStyle | The default value of TextStyle is a new instance of SmartTextEditorStyle. |
Examples
The following code demonstrates, how to use the TextStyle property in the smart text editor.
<ste:SfSmartTextEditor x:Name="ste">
<ste:SfSmartTextEditor.TextStyle>
<ste:SmartTextEditorStyle FontSize="16" TextColor="DarkBlue"/>
</ste:SfSmartTextEditor.TextStyle>
</ste:SfSmartTextEditor>
UserPhrases
Gets or sets the collection of user-defined custom phrases.
Declaration
public List<string> UserPhrases { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | The default value of UserPhrases is null. |
Examples
The following code demonstrates, how to use the UserPhrases property in the smart text editor.
UserRole
Gets or sets the role of the user interacting with the control.
Declaration
public string UserRole { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value of UserRole is null. |
Examples
The following code demonstrates, how to use the UserRole property in the smart text editor.
<ste:SfSmartTextEditor x:Name="ste"
UserRole="Maintainer of an open-source project replying to GitHub issues">
</ste:SfSmartTextEditor>
Methods
OnHandlerChanged()
Method invokes when handler changed.
Declaration
protected override void OnHandlerChanged()
Overrides
Events
TextChanged
Event occurs when the text is changed.
Declaration
public event EventHandler<TextChangedEventArgs> TextChanged
Event Type
| Type |
|---|
| System.EventHandler<TextChangedEventArgs> |