Class SfAIAssistView
Represents a chat control designed to display AI Assist conversation
Implements
Inherited Members
Namespace: Syncfusion.WinForms.AIAssistView
Assembly: Syncfusion.SfAIAssistView.WinForms.dll
Syntax
public class SfAIAssistView : BaseControl, IThemeProvider, IVisualStyle, INotifyPropertyChanged, IDisposable
Constructors
SfAIAssistView()
Initializes a new instance of the SfAIAssistView class.
Declaration
public SfAIAssistView()
Properties
BaseThemeName
Gets or sets the BaseThemeName of the control.
Declaration
protected string BaseThemeName { get; set; }
Property Value
| Type |
|---|
| System.String |
CanApplyTheme
Gets or sets a value indicating whether the theme can be applied to the control.
Declaration
public bool CanApplyTheme { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
EnableStopResponding
Gets or sets a value indicating whether the Stop Responding button should be enabled when ShowTypingIndicator is true.
Declaration
public bool EnableStopResponding { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ForeColor
Gets or sets the foreground color of the control.
Declaration
public override Color ForeColor { get; }
Property Value
| Type |
|---|
| System.Drawing.Color |
IsResponseToolBarVisible
Gets or sets a value indicating whether the response toolbar is visible.
Declaration
public bool IsResponseToolBarVisible { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Messages
Gets or sets the collection of the messages
Declaration
public object Messages { get; set; }
Property Value
| Type |
|---|
| System.Object |
ResponseToolBarItems
Gets or sets a collection of toolbar items directly, providing a simple property-based alternative to virtual method override.
Declaration
public ObservableCollection<ResponseToolBarItem> ResponseToolBarItems { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<ResponseToolBarItem> |
ShowTypingIndicator
Gets or sets a value indicating whether the typing indicator should be displayed at the bottom of the chat control to notify when a user is typing.
Declaration
public bool ShowTypingIndicator { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
StopRespondingButtonCancelingText
Gets or sets the text shown on the Stop Responding button while cancelling. If not set, defaults to "Cancelling...".
Declaration
public string StopRespondingButtonCancelingText { get; set; }
Property Value
| Type |
|---|
| System.String |
StopRespondingButtonText
Gets or sets the text shown on the Stop Responding button. If not set, defaults to "Stop Responding".
Declaration
public string StopRespondingButtonText { get; set; }
Property Value
| Type |
|---|
| System.String |
StopRespondingHoldSeconds
Gets or sets the number of seconds the Stop Responding button remains disabled after being clicked.
Declaration
public int StopRespondingHoldSeconds { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Style
Gets or sets the style for the SfAIAssistView control.
Declaration
public AssistViewStyle Style { get; set; }
Property Value
| Type |
|---|
| AssistViewStyle |
Suggestions
Gets or sets the collection of suggestion items.
Declaration
public object Suggestions { get; set; }
Property Value
| Type |
|---|
| System.Object |
ThemeName
Gets or sets the theme name of the SfAIAssistView control.
Declaration
public string ThemeName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null. |
Remarks
The theme will be applied only when the particular theme for this control has included the Themes assembly.
TypingIndicator
Gets or sets the indicator that notifies when a user is typing.
Declaration
public TypingIndicator TypingIndicator { get; set; }
Property Value
| Type |
|---|
| TypingIndicator |
User
Gets or sets the current author of a message.
Declaration
public Author User { get; set; }
Property Value
| Type |
|---|
| Author |
VisualTheme
Gets or sets the visualTheme of the control, which holds the ThemeName applied from SkinManager
Declaration
protected string VisualTheme { get; set; }
Property Value
| Type |
|---|
| System.String |
Methods
Dispose(Boolean)
Method to dispose all the Events and control
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
GetControlName(String)
Gets the name of the control.
Declaration
public override string GetControlName(string controlName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | controlName | The default name of the control. |
Returns
| Type | Description |
|---|---|
| System.String | The string representing the control name. |
Overrides
GetDefaultResponseToolBarItems()
When overridden in a derived class, returns a collection of default toolbar items to be displayed on bot messages.
Declaration
protected virtual ObservableCollection<ResponseToolBarItem> GetDefaultResponseToolBarItems()
Returns
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<ResponseToolBarItem> |
GetToolBarItem(TextMessage, String)
Gets a toolbar item from a message by name.
Declaration
public ResponseToolBarItem GetToolBarItem(TextMessage message, string itemName)
Parameters
| Type | Name | Description |
|---|---|---|
| TextMessage | message | The message containing the toolbar item. |
| System.String | itemName | The name of the toolbar item. |
Returns
| Type | Description |
|---|---|
| ResponseToolBarItem | The toolbar item or null if not found. |
OnResponseToolBarItemClicked(ResponseToolBarItemClickedEventArgs)
Raises the ResponseToolBarItemClicked event.
Declaration
protected virtual void OnResponseToolBarItemClicked(ResponseToolBarItemClickedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ResponseToolBarItemClickedEventArgs | e | The event database providing context about the clicked toolbar item and message. |
OnStopRespondingButtonClicked(EventArgs)
Raises the StopRespondingButtonClicked event.
Declaration
protected virtual void OnStopRespondingButtonClicked(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | The event arguments. |
OnThemeNameChanged(String)
Helps to apply the ThemeName settings in control
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | themeName | The ThemeName of the Control |
Overrides
SetBannerView(String, String, Image, BannerStyle)
Sets the banner view in the SfAIAssistView with title, subtitle, icon, and optional style.
Declaration
public void SetBannerView(string title, string subTitle, Image icon, BannerStyle style = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | title | The title text for the banner. |
| System.String | subTitle | The subtitle text for the banner. |
| System.Drawing.Image | icon | The image icon for the banner. |
| BannerStyle | style | The optional style configuration for the banner. |
SetBotView(Object, Control)
Assign a custom control to represent a specific bot message model.
Declaration
public void SetBotView(object messageModel, Control customControl)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | messageModel | The message data model associated with the custom control. |
| System.Windows.Forms.Control | customControl | The custom control to be displayed for the bot message. |
SetMessageView(Boolean, Delegate)
Assigns a custom control view to represent a specific message type.
Declaration
public void SetMessageView(bool isBot, Delegate ControlFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isBot | True if the view is for bot messages, false for user messages. |
| System.Delegate | ControlFactory | The delegate that creates the custom control instance. |
SetToolBarItemVisibility(TextMessage, String, Boolean)
Sets the visibility of a toolbar item on a message.
Declaration
public void SetToolBarItemVisibility(TextMessage message, string itemName, bool visible)
Parameters
| Type | Name | Description |
|---|---|---|
| TextMessage | message | The message containing the toolbar item. |
| System.String | itemName | The name of the toolbar item. |
| System.Boolean | visible | True to show; false to hide. |
SetToolBarVisibility(TextMessage, Boolean)
Sets the toolbar visibility for a message.
Declaration
public void SetToolBarVisibility(TextMessage message, bool visible)
Parameters
| Type | Name | Description |
|---|---|---|
| TextMessage | message | The message whose toolbar visibility should be changed. |
| System.Boolean | visible | True to show the toolbar; false to hide it. |
SetUserView(Object, Control)
Assign a custom control to represent a specific user message model.
Declaration
public void SetUserView(object messageModel, Control customControl)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | messageModel | The message data model associated with the custom control. |
| System.Windows.Forms.Control | customControl | The custom control to be displayed for the User message. |
Events
PromptRequest
Occurs when a prompt is submitted by the user in the SfAIAssistView control.
Declaration
public event EventHandler<PromptRequestEventArgs> PromptRequest
Event Type
| Type |
|---|
| System.EventHandler<PromptRequestEventArgs> |
PropertyChanged
Represents the method that will handle the System.ComponentModel.INotifyPropertyChanged.PropertyChanged event.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type |
|---|
| System.ComponentModel.PropertyChangedEventHandler |
ResponseToolBarItemClicked
Occurs when a response toolbar item is clicked.
Declaration
public event EventHandler<ResponseToolBarItemClickedEventArgs> ResponseToolBarItemClicked
Event Type
| Type |
|---|
| System.EventHandler<ResponseToolBarItemClickedEventArgs> |
StopRespondingButtonClicked
Occurs when the Stop Responding button is clicked.
Declaration
public event EventHandler StopRespondingButtonClicked
Event Type
| Type |
|---|
| System.EventHandler |
Remarks
This event is triggered when the user clicks the Stop Responding button to cancel an ongoing AI response.
SuggestionSelected
Occurs when the suggestion item is selected in the SfAIAssistView control.
Declaration
public event EventHandler<SuggestionSelectedEventArgs> SuggestionSelected
Event Type
| Type |
|---|
| System.EventHandler<SuggestionSelectedEventArgs> |
Explicit Interface Implementations
IVisualStyle.VisualTheme
Gets or sets the VisualTheme of the SfListView control.
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
| Type |
|---|
| System.String |
IThemeProvider.BaseThemeName
Gets the base theme name used for theme calculations.
Declaration
string IThemeProvider.BaseThemeName { get; set; }
Returns
| Type |
|---|
| System.String |