Interface ISuggestionProvider
Inserts the selected item into the SfRichTextBoxAdv control at cursor position
Namespace: Syncfusion.UI.Xaml.RichTextBoxAdv
Assembly: Syncfusion.SfRichTextBoxAdv.UWP.dll
Syntax
public interface ISuggestionProvider
Remarks
You can implement your own logic to insert the selected item into the SfRichTextBoxAdv instance.
Examples
The following code example demonstrates how to add automatic suggestion settings for SfRichTextBoxAdv control.
<!-- Defines the SfRichTextBoxAdv control. -->
<Window.Resources>
<coll:ArrayList x:Key="suggestionItems">
<syncfusion:NameSuggestionItem Name="Nancy Davolio" Link="mailto:[email protected]" ImageSource="images/nancy.png" />
<syncfusion:NameSuggestionItem Name="Andrew Fuller" Link="mailto:[email protected]" ImageSource="images/andrew.png"/>
<syncfusion:NameSuggestionItem Name="Steven Buchanan" Link="mailto:[email protected]" ImageSource="images/steven.png"/>
</coll:ArrayList>
<Style x:Key="suggestionBoxStyle" TargetType="ListBox">
<Setter Property = "MinWidth" Value="300" />
<Setter Property = "MinHeight" Value="250" />
<Setter Property = "ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="44" Padding="12" AutomationProperties.Name="{Binding Name}">
<Image Source = "{Binding ImageSource}" Height="16" Width="16" VerticalAlignment="Center" />
<TextBlock Text = "{Binding Name}" FontSize="14" VerticalAlignment="Center" Margin="12,0,0,0" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv">
<RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
<RichTextBoxAdv:NameSuggestionProvider MentionCharacter="@" ItemsSource="{StaticResource suggestionItems}" SuggestionBoxStyle="{StaticResource suggestionBoxStyle}">
</RichTextBoxAdv:NameSuggestionProvider>
</RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
</RichTextBoxAdv:SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv>
//Defines the SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
ISuggestionProvider suggestionProvider = new NameSuggestionProvider();
suggestionProvider.MentionCharacter = '@';
suggestionProvider.SuggestionBoxStyle = Resources["suggestionBoxStyle"] as Style;
List<NameSuggestionItem> suggestionItems = new List<NameSuggestionItem>();
NameSuggestionItem suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Nancy Davolio";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/nancy.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Andrew Fuller";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/andrew.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Steven Buchanan";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/steven.png";
suggestionItems.Add(suggestionItem);
(suggestionProvider as NameSuggestionProvider).ItemsSource = suggestionItems;
richTextBoxAdv.SuggestionSettings = new SuggestionSettings();
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider);
' Defines the SfRichTextBoxAdv control.
Dim richTextBoxAdv As SfRichTextBoxAdv = New SfRichTextBoxAdv()
Dim suggestionProvider As ISuggestionProvider = New NameSuggestionProvider()
suggestionProvider.MentionCharacter = '@'
suggestionProvider.SuggestionBoxStyle = TryCast(Resources("suggestionBoxStyle"), Style)
Dim suggestionItems As List<NameSuggestionItem> = New List<NameSuggestionItem>()
Dim suggestionItem As NameSuggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Nancy Davolio"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/nancy.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Andrew Fuller"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/andrew.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Steven Buchanan"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/steven.png"
suggestionItems.Add(suggestionItem)
TryCast(suggestionProvider, NameSuggestionProvider).ItemsSource = suggestionItems
richTextBoxAdv.SuggestionSettings = New SuggestionSettings()
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider)
Properties
MentionCharacter
Gets or sets a character that represents the mention character for ISuggestionProvider instance.
Declaration
char MentionCharacter { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Char | A character that represents the mention character for ISuggestionProvider instance. |
Examples
The following code example demonstrates how to add automatic suggestion settings for SfRichTextBoxAdv control.
<!-- Defines the SfRichTextBoxAdv control. -->
<Window.Resources>
<coll:ArrayList x:Key="suggestionItems">
<syncfusion:NameSuggestionItem Name = "Nancy Davolio" Link="mailto:[email protected]" ImageSource="images/nancy.png" />
<syncfusion:NameSuggestionItem Name = "Andrew Fuller" Link="mailto:[email protected]" ImageSource="images/andrew.png"/>
<syncfusion:NameSuggestionItem Name = "Steven Buchanan" Link="mailto:[email protected]" ImageSource="images/steven.png"/>
</coll:ArrayList>
<Style x:Key="suggestionBoxStyle" TargetType="ListBox">
<Setter Property = "MinWidth" Value="300" />
<Setter Property = "MinHeight" Value="250" />
<Setter Property = "ItemTemplate" >
<Setter.Value >
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="44" Padding="12" AutomationProperties.Name="{Binding Name}">
<Image Source = "{Binding ImageSource}" Height="16" Width="16" VerticalAlignment="Center"/>
<TextBlock Text = "{Binding Name}" FontSize="14" VerticalAlignment="Center" Margin="12,0,0,0" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv">
<RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
<RichTextBoxAdv:NameSuggestionProvider MentionCharacter="@" ItemsSource="{StaticResource suggestionItems}" SuggestionBoxStyle="{StaticResource suggestionBoxStyle}">
</RichTextBoxAdv:NameSuggestionProvider>
</RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
</RichTextBoxAdv:SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv>
// Defines the SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
ISuggestionProvider suggestionProvider = new NameSuggestionProvider();
suggestionProvider.MentionCharacter = '@';
suggestionProvider.SuggestionBoxStyle = Resources["suggestionBoxStyle"] as Style;
List<NameSuggestionItem> suggestionItems = new List<NameSuggestionItem>();
NameSuggestionItem suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Nancy Davolio";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/nancy.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Andrew Fuller";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/andrew.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Steven Buchanan";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/steven.png";
suggestionItems.Add(suggestionItem);
(suggestionProvider as NameSuggestionProvider).ItemsSource = suggestionItems;
richTextBoxAdv.SuggestionSettings = new SuggestionSettings();
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider);
' Defines the SfRichTextBoxAdv control.
Dim richTextBoxAdv As SfRichTextBoxAdv = New SfRichTextBoxAdv()
Dim suggestionProvider As ISuggestionProvider = New NameSuggestionProvider()
suggestionProvider.MentionCharacter = '@'
suggestionProvider.SuggestionBoxStyle = TryCast(Resources("suggestionBoxStyle"), Style)
Dim suggestionItems As List<NameSuggestionItem> = New List<NameSuggestionItem>()
Dim suggestionItem As NameSuggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Nancy Davolio"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/nancy.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Andrew Fuller"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/andrew.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Steven Buchanan"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/steven.png"
suggestionItems.Add(suggestionItem)
TryCast(suggestionProvider, NameSuggestionProvider).ItemsSource = suggestionItems
richTextBoxAdv.SuggestionSettings = New SuggestionSettings()
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider)
SuggestionBoxStyle
Gets or sets the style used by Windows.UI.Xaml.Controls.ListBox element when it is rendered for displaying suggestion items from this ISuggestionProvider instance.
Declaration
Style SuggestionBoxStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Windows.UI.Xaml.Style | The Windows.UI.Xaml.Style instance. |
Examples
The following code example demonstrates how to add automatic suggestion settings for SfRichTextBoxAdv control.
<!-- Defines the SfRichTextBoxAdv control. -->
<Window.Resources>
<coll:ArrayList x:Key="suggestionItems">
<syncfusion:NameSuggestionItem Name = "Nancy Davolio" Link="mailto:[email protected]" ImageSource="images/nancy.png" />
<syncfusion:NameSuggestionItem Name = "Andrew Fuller" Link="mailto:[email protected]" ImageSource="images/andrew.png"/>
<syncfusion:NameSuggestionItem Name = "Steven Buchanan" Link="mailto:[email protected]" ImageSource="images/steven.png"/>
</coll:ArrayList>
<Style x:Key="suggestionBoxStyle" TargetType="ListBox">
<Setter Property = "MinWidth" Value="300" />
<Setter Property = "MinHeight" Value="250" />
<Setter Property = "ItemTemplate" >
<Setter.Value >
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="44" Padding="12" AutomationProperties.Name="{Binding Name}">
<Image Source = "{Binding ImageSource}" Height="16" Width="16" VerticalAlignment="Center"/>
<TextBlock Text = "{Binding Name}" FontSize="14" VerticalAlignment="Center" Margin="12,0,0,0" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv">
<RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
<RichTextBoxAdv:NameSuggestionProvider MentionCharacter="@" ItemsSource="{StaticResource suggestionItems}" SuggestionBoxStyle="{StaticResource suggestionBoxStyle}">
</RichTextBoxAdv:NameSuggestionProvider>
</RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
</RichTextBoxAdv:SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv>
// Defines the SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
ISuggestionProvider suggestionProvider = new NameSuggestionProvider();
suggestionProvider.MentionCharacter = '@';
suggestionProvider.SuggestionBoxStyle = Resources["suggestionBoxStyle"] as Style;
List<NameSuggestionItem> suggestionItems = new List<NameSuggestionItem>();
NameSuggestionItem suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Nancy Davolio";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/nancy.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Andrew Fuller";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/andrew.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Steven Buchanan";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/steven.png";
suggestionItems.Add(suggestionItem);
(suggestionProvider as NameSuggestionProvider).ItemsSource = suggestionItems;
richTextBoxAdv.SuggestionSettings = new SuggestionSettings();
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider);
' Defines the SfRichTextBoxAdv control.
Dim richTextBoxAdv As SfRichTextBoxAdv = New SfRichTextBoxAdv()
Dim suggestionProvider As ISuggestionProvider = New NameSuggestionProvider()
suggestionProvider.MentionCharacter = '@'
suggestionProvider.SuggestionBoxStyle = TryCast(Resources("suggestionBoxStyle"), Style)
Dim suggestionItems As List<NameSuggestionItem> = New List<NameSuggestionItem>()
Dim suggestionItem As NameSuggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Nancy Davolio"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/nancy.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Andrew Fuller"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/andrew.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Steven Buchanan"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/steven.png"
suggestionItems.Add(suggestionItem)
TryCast(suggestionProvider, NameSuggestionProvider).ItemsSource = suggestionItems
richTextBoxAdv.SuggestionSettings = New SuggestionSettings()
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider)
Methods
Dispose()
Releases unmanaged and - optionally - managed resources.
Declaration
void Dispose()
InsertSelectedItem(SfRichTextBoxAdv, Object)
Inserts the selected item into the SfRichTextBoxAdv control at cursor position
Declaration
void InsertSelectedItem(SfRichTextBoxAdv richTextBoxAdv, object selectedItem)
Parameters
| Type | Name | Description |
|---|---|---|
| SfRichTextBoxAdv | richTextBoxAdv | The instance of the SfRichTextBoxAdv. |
| System.Object | selectedItem | The instance of the selected item. |
Remarks
You can implement your own logic to insert the selected item by inheriting ISuggestionProvider interface.
Examples
The following code example demonstrates how to add automatic suggestion settings for SfRichTextBoxAdv control.
<!-- Defines the SfRichTextBoxAdv control. -->
<Window.Resources>
<coll:ArrayList x:Key="suggestionItems">
<syncfusion:NameSuggestionItem Name="Nancy Davolio" Link="mailto:[email protected]" ImageSource="images/nancy.png" />
<syncfusion:NameSuggestionItem Name="Andrew Fuller" Link="mailto:[email protected]" ImageSource="images/andrew.png"/>
<syncfusion:NameSuggestionItem Name="Steven Buchanan" Link="mailto:[email protected]" ImageSource="images/steven.png"/>
</coll:ArrayList>
<Style x:Key="suggestionBoxStyle" TargetType="ListBox">
<Setter Property = "MinWidth" Value="300" />
<Setter Property = "MinHeight" Value="250" />
<Setter Property = "ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="44" Padding="12" AutomationProperties.Name="{Binding Name}">
<Image Source = "{Binding ImageSource}" Height="16" Width="16" VerticalAlignment="Center" />
<TextBlock Text = "{Binding Name}" FontSize="14" VerticalAlignment="Center" Margin="12,0,0,0" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv">
<RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
<RichTextBoxAdv:NameSuggestionProvider MentionCharacter="@" ItemsSource="{StaticResource suggestionItems}" SuggestionBoxStyle="{StaticResource suggestionBoxStyle}">
</RichTextBoxAdv:NameSuggestionProvider>
</RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
</RichTextBoxAdv:SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv>
// Defines the SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
ISuggestionProvider suggestionProvider = new NameSuggestionProvider();
suggestionProvider.MentionCharacter = '@';
suggestionProvider.SuggestionBoxStyle = Resources["suggestionBoxStyle"] as Style;
List<NameSuggestionItem> suggestionItems = new List<NameSuggestionItem>();
NameSuggestionItem suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Nancy Davolio";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/nancy.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Andrew Fuller";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/andrew.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Steven Buchanan";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/steven.png";
suggestionItems.Add(suggestionItem);
(suggestionProvider as NameSuggestionProvider).ItemsSource = suggestionItems;
richTextBoxAdv.SuggestionSettings = new SuggestionSettings();
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider);
' Defines the SfRichTextBoxAdv control.
Dim richTextBoxAdv As SfRichTextBoxAdv = New SfRichTextBoxAdv()
Dim suggestionProvider As ISuggestionProvider = New NameSuggestionProvider()
suggestionProvider.MentionCharacter = '@'
suggestionProvider.SuggestionBoxStyle = TryCast(Resources("suggestionBoxStyle"), Style)
Dim suggestionItems As List<NameSuggestionItem> = New List<NameSuggestionItem>()
Dim suggestionItem As NameSuggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Nancy Davolio"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/nancy.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Andrew Fuller"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/andrew.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Steven Buchanan"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/steven.png"
suggestionItems.Add(suggestionItem)
TryCast(suggestionProvider, NameSuggestionProvider).ItemsSource = suggestionItems
richTextBoxAdv.SuggestionSettings = New SuggestionSettings()
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider)
Search(String)
Searches the suggestion source of ISuggestionProvider instance.
Declaration
List<object> Search(string searchText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | searchText | The text to search in suggestion items. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Object> | Returns the collection of matching suggestion items. |
Remarks
You can implement your own search logic by inheriting ISuggestionProvider interface.
Examples
The following code example demonstrates how to add automatic suggestion settings for SfRichTextBoxAdv control.
<!-- Defines the SfRichTextBoxAdv control. -->
<Window.Resources>
<coll:ArrayList x:Key="suggestionItems">
<syncfusion:NameSuggestionItem Name="Nancy Davolio" Link="mailto:[email protected]" ImageSource="images/nancy.png" />
<syncfusion:NameSuggestionItem Name="Andrew Fuller" Link="mailto:[email protected]" ImageSource="images/andrew.png"/>
<syncfusion:NameSuggestionItem Name="Steven Buchanan" Link="mailto:[email protected]" ImageSource="images/steven.png"/>
</coll:ArrayList>
<Style x:Key="suggestionBoxStyle" TargetType="ListBox">
<Setter Property = "MinWidth" Value="300" />
<Setter Property = "MinHeight" Value="250" />
<Setter Property = "ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="44" Padding="12" AutomationProperties.Name="{Binding Name}">
<Image Source = "{Binding ImageSource}" Height="16" Width="16" VerticalAlignment="Center" />
<TextBlock Text = "{Binding Name}" FontSize="14" VerticalAlignment="Center" Margin="12,0,0,0" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv">
<RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings>
<RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
<RichTextBoxAdv:NameSuggestionProvider MentionCharacter="@" ItemsSource="{StaticResource suggestionItems}" SuggestionBoxStyle="{StaticResource suggestionBoxStyle}">
</RichTextBoxAdv:NameSuggestionProvider>
</RichTextBoxAdv:SuggestionSettings.SuggestionProviders>
</RichTextBoxAdv:SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv.SuggestionSettings>
</RichTextBoxAdv:SfRichTextBoxAdv>
// Defines the SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
ISuggestionProvider suggestionProvider = new NameSuggestionProvider();
suggestionProvider.MentionCharacter = '@';
suggestionProvider.SuggestionBoxStyle = Resources["suggestionBoxStyle"] as Style;
List<NameSuggestionItem> suggestionItems = new List<NameSuggestionItem>();
NameSuggestionItem suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Nancy Davolio";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/nancy.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Andrew Fuller";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/andrew.png";
suggestionItems.Add(suggestionItem);
suggestionItem = new NameSuggestionItem();
suggestionItem.Name = "Steven Buchanan";
suggestionItem.Link="mailto:[email protected]";
suggestionItem.ImageSource="images/steven.png";
suggestionItems.Add(suggestionItem);
(suggestionProvider as NameSuggestionProvider).ItemsSource = suggestionItems;
richTextBoxAdv.SuggestionSettings = new SuggestionSettings();
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider);
' Defines the SfRichTextBoxAdv control.
Dim richTextBoxAdv As SfRichTextBoxAdv = New SfRichTextBoxAdv()
Dim suggestionProvider As ISuggestionProvider = New NameSuggestionProvider()
suggestionProvider.MentionCharacter = '@'
suggestionProvider.SuggestionBoxStyle = TryCast(Resources("suggestionBoxStyle"), Style)
Dim suggestionItems As List<NameSuggestionItem> = New List<NameSuggestionItem>()
Dim suggestionItem As NameSuggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Nancy Davolio"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/nancy.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Andrew Fuller"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/andrew.png"
suggestionItems.Add(suggestionItem)
suggestionItem = New NameSuggestionItem()
suggestionItem.Name = "Steven Buchanan"
suggestionItem.Link = "mailto:[email protected]"
suggestionItem.ImageSource = "images/steven.png"
suggestionItems.Add(suggestionItem)
TryCast(suggestionProvider, NameSuggestionProvider).ItemsSource = suggestionItems
richTextBoxAdv.SuggestionSettings = New SuggestionSettings()
richTextBoxAdv.SuggestionSettings.SuggestionProviders.Add(suggestionProvider)