Class SfChat
A user interface control that can create modern conversational chatbot experiences in mobile applications. It is a flexible control that shows a conversation between two or more users in a fully customizable layout.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Chat
Assembly: Syncfusion.Maui.Chat.dll
Syntax
public class SfChat : SfContentView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IParentThemeElement, IThemeElement, ITouchListener
Constructors
SfChat()
Initializes a new instance of the SfChat class.
Declaration
public SfChat()
Fields
AllowMultilineInputProperty
Identifies the AllowMultilineInput Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowMultilineInputProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowSwipingProperty
Identifies the AllowSwiping bindable property.
Declaration
public static readonly BindableProperty AllowSwipingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AttachmentButtonCommandParameterProperty
Identifies the AttachmentButtonCommandParameter Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AttachmentButtonCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AttachmentButtonCommandProperty
Identifies the AttachmentButtonCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AttachmentButtonCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AttachmentButtonTemplateProperty
Identifies the AttachmentButtonTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AttachmentButtonTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CanAutoScrollToBottomProperty
Identifies the CanAutoScrollToBottom Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CanAutoScrollToBottomProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CardCommandProperty
Identifies the CardCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CardCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CurrentUserProperty
Identifies the CurrentUser Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CurrentUserProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
DeliveredIconProperty
Identifies the DeliveredIcon Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty DeliveredIconProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
EndSwipeTemplateProperty
Identifies the EndSwipeTemplate bindable property.
Declaration
public static readonly BindableProperty EndSwipeTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
FailedIconProperty
Identifies the FailedIcon Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty FailedIconProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ImageTappedCommandProperty
Identifies the ImageTappedCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ImageTappedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
IncomingMessageTimestampFormatProperty
Identifies the IncomingMessageTimestampFormat Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty IncomingMessageTimestampFormatProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
IsLazyLoadingProperty
Identifies the IsBusy Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty IsLazyLoadingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
ItemsSourceConverterProperty
Identifies the ItemsSourceConverter Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ItemsSourceConverterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ItemsSourceProperty
Identifies the ItemsSource Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
LoadMoreBehaviorProperty
Identifies the LoadMoreBehavior Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreBehaviorProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
LoadMoreCommandParameterProperty
Identifies the LoadMoreCommandParameter Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
LoadMoreCommandProperty
Identifies the LoadMoreCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
LoadMoreTemplateProperty
Identifies the LoadMoreTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
MaxSwipeOffsetProperty
Identifies the MaxSwipeOffset bindable property.
Declaration
public static readonly BindableProperty MaxSwipeOffsetProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
MessageDoubleTappedCommandProperty
Identifies the MessageDoubleTappedCommand bindable property.
Declaration
public static readonly BindableProperty MessageDoubleTappedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
MessageLongPressedCommandProperty
Identifies the MessageLongPressedCommand bindable property.
Declaration
public static readonly BindableProperty MessageLongPressedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
MessageShapeProperty
Identifies the MessageShape Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty MessageShapeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
MessageSpacingProperty
Identifies the MessageSpacing Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty MessageSpacingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
MessagesProperty
Identifies the Messages Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty MessagesProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
MessageTappedCommandProperty
Identifies the MessageTappedCommand bindable property.
Declaration
public static readonly BindableProperty MessageTappedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
MessageTemplateProperty
Identifies the MessageTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty MessageTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
OutgoingMessageTimestampFormatProperty
Identifies the OutgoingMessageTimestampFormat Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty OutgoingMessageTimestampFormatProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ReadIconProperty
Identifies the SeenIcon Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ReadIconProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ScrollToBottomButtonTemplateProperty
Identifies the ScrollToBottomButtonTemplate bindable property. Specifies the Microsoft.Maui.Controls.DataTemplate used to customize the appearance of the scroll-to-bottom button in the SfChat control.
Declaration
public static readonly BindableProperty ScrollToBottomButtonTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SendMessageCommandProperty
Identifies the SendMessageCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SendMessageCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SentIconProperty
Identifies the SendIcon Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SentIconProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowAttachmentButtonProperty
Identifies the ShowAttachmentButton Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowAttachmentButtonProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowDeliveryStateProperty
Identifies the ShowDeliveryStatus Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowDeliveryStateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowIncomingMessageAuthorNameProperty
Identifies the ShowIncomingMessageAuthorName Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowIncomingMessageAuthorNameProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowIncomingMessageAvatarProperty
Identifies the ShowIncomingMessageAvatar Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowIncomingMessageAvatarProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowIncomingMessageTimestampProperty
Identifies the ShowIncomingMessageTimestamp Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowIncomingMessageTimestampProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowKeyboardAlwaysProperty
Identifies the ShowKeyboardAlways Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowKeyboardAlwaysProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowMessageInputViewProperty
Identifies the ShowMessageInputView Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowMessageInputViewProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowOutgoingMessageAuthorNameProperty
Identifies the ShowOutgoingMessageAuthorName Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowOutgoingMessageAuthorNameProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowOutgoingMessageAvatarProperty
Identifies the ShowOutgoingMessageAvatar Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowOutgoingMessageAvatarProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowOutgoingMessageTimestampProperty
Identifies the ShowOutgoingMessageTimestamp Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowOutgoingMessageTimestampProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowScrollToBottomButtonProperty
Identifies the ShowScrollToBottomButton bindable property. Determines whether the scroll-to-bottom button is visible in the SfChat control.
Declaration
public static readonly BindableProperty ShowScrollToBottomButtonProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowTimeBreakProperty
Identifies the ShowTimeBreak Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowTimeBreakProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowTypingIndicatorProperty
Identifies the ShowTypingIndicator Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowTypingIndicatorProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
StartSwipeTemplateProperty
Identifies the StartSwipeTemplate bindable property.
Declaration
public static readonly BindableProperty StartSwipeTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This bindable property is read-only.
StickyTimeBreakProperty
Identifies the StickyTimeBreak Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty StickyTimeBreakProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SuggestionItemSelectedCommandProperty
Identifies the SuggestionItemSelectedCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SuggestionItemSelectedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SuggestionsProperty
Identifies the Suggestions Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SuggestionsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
TimeBreakTemplateProperty
Identifies the TimeBreakTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty TimeBreakTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
TypingIndicatorProperty
Identifies the TypingIndicator Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty TypingIndicatorProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
TypingIndicatorViewHeightProperty
Identifies the TypingIndicatorViewHeight bindable property.
Declaration
public static readonly BindableProperty TypingIndicatorViewHeightProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Properties
AllowMultilineInput
Gets or sets a value indicating whether the Editor should accept multiline text input or single line text input for outgoing messages. This is a bindable property.
Declaration
public bool AllowMultilineInput { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the editor control should be Multiple-line text input , otherwise false. The default value is true. |
AllowSwiping
Gets or sets a value indicating whether to enable swiping of messages or not.
Declaration
public bool AllowSwiping { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AttachmentButtonCommand
Gets or sets the command that will be executed when the attachment button is tapped.
Declaration
public ICommand AttachmentButtonCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
AttachmentButtonCommandParameter
Gets or sets the parameter for AttachmentButtonCommandParameter.
Declaration
public object AttachmentButtonCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
AttachmentButtonTemplate
Gets or sets the template to be loaded in the attachment button area of the message input view in SfChat.
Declaration
public DataTemplate AttachmentButtonTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
CanAutoScrollToBottom
Gets or sets a value indicating whether SfChat should be auto scrolled to the newly added message. This is applicable for both incoming and outgoing message. This is a bindable property.
Declaration
public bool CanAutoScrollToBottom { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true To auto scroll to the newly added message, otherwise false. The default value is true. |
CardCommand
Gets or sets the command that will be executed when the user taps a card or clicks an action button in a card message.
Declaration
public ICommand CardCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CurrentUser
Gets or sets the current author of a message.
Declaration
public Author CurrentUser { get; set; }
Property Value
| Type |
|---|
| Author |
DeliveredIcon
Gets or sets the image to be displayed for the delivered icon in the chat.
Declaration
public ImageSource DeliveredIcon { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.ImageSource | An Microsoft.Maui.Controls.ImageSource representing the image for delivered messages. |
Editor
Gets the
Declaration
public Editor Editor { get; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.Editor |
EndSwipeTemplate
Gets or sets the template view to be displayed when swiping a message from 'right to left'. The SfChat enables you to load a desired Content to be displayed when swiping towards left using this property. The swipe views will be displayed only when AllowSwiping is set as true.
Declaration
public DataTemplate EndSwipeTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.DataTemplate | The template that is displayed when right to left swipe action is performed. |
FailedIcon
Gets or sets the image to be displayed for the Failed icon in the chat.
Declaration
public ImageSource FailedIcon { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.ImageSource | An Microsoft.Maui.Controls.ImageSource representing the image for Failed messages. |
ImageTappedCommand
Gets or sets the command that will be executed when the user tapped an image in the image message.
Declaration
public ICommand ImageTappedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
Remarks
The ImageTappedEventArgs is passed as a parameter.
IncomingMessageTimestampFormat
Gets or sets a value that indicates the format applied to time stamp for all the incoming messages.
Declaration
public string IncomingMessageTimestampFormat { get; set; }
Property Value
| Type |
|---|
| System.String |
IsLazyLoading
Gets or sets a value indicating whether the busy state of the SfChat while executing the LoadMoreCommand.
Declaration
public bool IsLazyLoading { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ItemsSource
Gets or sets the message collection for the chat. Each item in the collection will be converted to chat message and added to Messages.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
| Type |
|---|
| System.Collections.IEnumerable |
ItemsSourceConverter
Gets or sets the converter used to convert data objects to chat messages and vice versa.
Declaration
public IChatMessageConverter ItemsSourceConverter { get; set; }
Property Value
| Type |
|---|
| IChatMessageConverter |
LoadMoreBehavior
Gets or sets the
Declaration
public LoadMoreOption LoadMoreBehavior { get; set; }
Property Value
| Type |
|---|
| LoadMoreOption |
LoadMoreCommand
Gets or sets the command that will be executed when the load more view is tapped or when the load more operation is triggered.
Declaration
public ICommand LoadMoreCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
LoadMoreCommandParameter
Gets or sets the parameter for LoadMoreCommand.
Declaration
public object LoadMoreCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
LoadMoreTemplate
Gets or sets the template that will be loaded as load more view when SfChat is scrolled to the top of the message collection. If it is null, the default load more view will be loaded.
Declaration
public DataTemplate LoadMoreTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
MaxSwipeOffset
Gets or sets a value indicating the maximum offset/pixels a message will be moved upon swiping. The default value is 100.
Declaration
public double MaxSwipeOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The swipe offset value. |
MessageDoubleTappedCommand
Gets or sets System.Windows.Input.ICommand that will be executed when a message is double tapped in SfChat control.
Declaration
public ICommand MessageDoubleTappedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
MessageLongPressedCommand
Gets or sets System.Windows.Input.ICommand that will be executed when a message is long pressed/held in SfChat control.
Declaration
public ICommand MessageLongPressedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
Messages
Gets or sets the collection of System.Object of messages to be displayed in the chat.
Declaration
public IList<object> Messages { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<System.Object> | A collection of System.Object. The default value is Empty. |
MessageShape
Gets or sets the shape of the message view.
Declaration
public MessageShape MessageShape { get; set; }
Property Value
| Type |
|---|
| MessageShape |
MessageSpacing
Gets or sets the spacing between the messages in SfChat.
Declaration
public double MessageSpacing { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The message spacing value. |
MessageTappedCommand
Gets or sets System.Windows.Input.ICommand that will be executed when a message is tapped in SfChat control.
Declaration
public ICommand MessageTappedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
MessageTemplate
Gets or sets the template used to display a message and its related information.
Declaration
public DataTemplate MessageTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
OutgoingMessageTimestampFormat
Gets or sets a value that indicates the format applied to time stamp for all the outgoing messages.
Declaration
public string OutgoingMessageTimestampFormat { get; set; }
Property Value
| Type |
|---|
| System.String |
ReadIcon
Gets or sets the image to be displayed for the seen icon in the chat.
Declaration
public ImageSource ReadIcon { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.ImageSource | An Microsoft.Maui.Controls.ImageSource representing the image for seen messages. |
ScrollToBottomButtonTemplate
Gets or sets the template for customizing the scroll-to-bottom button.
Declaration
public DataTemplate ScrollToBottomButtonTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.DataTemplate | The default value is null. |
SendMessageCommand
Gets or sets the command that will be executed when the user sends a message.
Declaration
public ICommand SendMessageCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
SentIcon
Gets or sets the image to be displayed for the send icon in the chat.
Declaration
public ImageSource SentIcon { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.ImageSource | An Microsoft.Maui.Controls.ImageSource representing the image for the send messages. |
ShowAttachmentButton
Gets or sets a value indicating whether the visibility of the attachment icon in SfChat.
Declaration
public bool ShowAttachmentButton { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True, if attachment icon is visible. Default value is false. |
ShowDeliveryState
Gets or sets a value indicating whether the delivery status should be shown for outgoing messages.
Declaration
public bool ShowDeliveryState { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
If set to true, the UI will display the delivery status (e.g., Failed, Sent, Delivered, Seen)
for messages sent by the current user.
ShowIncomingMessageAuthorName
Gets or sets a value indicating whether the message’s author name should be shown for all the incoming messages. This is a bindable property.
Declaration
public bool ShowIncomingMessageAuthorName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the author name is visible, otherwise false. The default value is true. |
ShowIncomingMessageAvatar
Gets or sets a value indicating whether the avatar should be shown for all the incoming messages.
Declaration
public bool ShowIncomingMessageAvatar { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the avatar is visible, otherwise false. The default value is true. |
ShowIncomingMessageTimestamp
Gets or sets a value indicating whether the time stamp details should be shown for all the incoming messages. This is a bindable property.
Declaration
public bool ShowIncomingMessageTimestamp { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the time stamp is visible, otherwise false. The default value is true. |
ShowKeyboardAlways
Gets or sets a value indicating whether keyboard should remain open even after a message is sent in SfChat.
Declaration
public bool ShowKeyboardAlways { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is true. |
Remarks
By default Keyboard will remain open after a message is sent in SfChat.
ShowMessageInputView
Gets or sets a value indicating whether the visibility of the message input/typing area in SfChat.
Declaration
public bool ShowMessageInputView { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | False, if message input area is not visible. Default value is true. |
ShowOutgoingMessageAuthorName
Gets or sets a value indicating whether the message’s author name should be shown for all the outgoing messages. This is a bindable property.
Declaration
public bool ShowOutgoingMessageAuthorName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the author name is visible, otherwise false. The default value is true. |
ShowOutgoingMessageAvatar
Gets or sets a value indicating whether the avatar should be shown for all the outgoing messages.
Declaration
public bool ShowOutgoingMessageAvatar { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the avatar is visible, otherwise false. The default value is false. |
ShowOutgoingMessageTimestamp
Gets or sets a value indicating whether the time stamp details should be shown for all the outgoing messages. This is a bindable property.
Declaration
public bool ShowOutgoingMessageTimestamp { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If the time stamp is visible, otherwise false. The default value is true. |
ShowScrollToBottomButton
Gets or sets a value indicating whether the scroll-to-bottom button is enabled.
Declaration
public bool ShowScrollToBottomButton { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is false. |
ShowTimeBreak
Gets or sets a value indicating whether a time break view can be shown in SfChat by grouping messages by date.
Declaration
public bool ShowTimeBreak { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowTypingIndicator
Gets or sets a value indicating whether the typing indicator should be displayed at the bottom of chat control to notify when a user is typing.
Declaration
public bool ShowTypingIndicator { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true If typing indicator is visible, otherwise false. The default value is true. |
StartSwipeTemplate
Gets or sets the template view to be displayed when swiping a message from 'left to right'. The SfChat enables you to load a desired Content to be displayed when swiping towards right using this property. The swipe views will be displayed only when AllowSwiping is set as true.
Declaration
public DataTemplate StartSwipeTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.DataTemplate | The template that is displayed when left to right swipe action is performed. |
StickyTimeBreak
Gets or sets a value indicating whether the timer break should be sticky or non-sticky.
Declaration
public bool StickyTimeBreak { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
SuggestionItemSelectedCommand
Gets or sets the command that will be executed when an item is selected from the list of suggestions that is displayed as an response to a user message.
Declaration
public ICommand SuggestionItemSelectedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
Suggestions
Gets or sets the list of items to be displayed as response to a user message. The suggestions will be displayed above the message typing/input area as part of the footer view.
Declaration
public ChatSuggestions Suggestions { get; set; }
Property Value
| Type |
|---|
| ChatSuggestions |
TimeBreakTemplate
Gets or sets the template used to display custom view in the time break area.
Declaration
public DataTemplate TimeBreakTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
TypingIndicator
Gets or sets the helper to set the settings for typing indicator.
Declaration
public ChatTypingIndicator TypingIndicator { get; set; }
Property Value
| Type |
|---|
| ChatTypingIndicator |
TypingIndicatorViewHeight
Gets or sets a value indicating the height of the typing indicator view in SfChat.The default value is 20. Set value as 0 to hide the typing indicator view area.
Declaration
public double TypingIndicatorViewHeight { get; set; }
Property Value
| Type |
|---|
| System.Double |
Methods
OnPropertyChanged(String)
Raised when SfChat control properties is changed.
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName | changed property name. |
ResetSwipeOffset()
Resets the swipe offset of the last swiped message and moves the swiped message to its default position.
Declaration
public void ResetSwipeOffset()
ScrollToMessage(Object)
Scrolls the SfChat to the given message.
Declaration
public void ScrollToMessage(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message to scroll to. |
Remarks
By default, the message is scrolled at end of chat.
Events
AttachmentButtonClicked
Occurs when the attachment button is tapped.
Declaration
public event EventHandler AttachmentButtonClicked
Event Type
| Type |
|---|
| System.EventHandler |
CardTapped
Occurs when the user taps a card or clicks an action button in a card message.
Declaration
public event EventHandler<CardTappedEventArgs> CardTapped
Event Type
| Type |
|---|
| System.EventHandler<CardTappedEventArgs> |
ImageTapped
Occurs when the user tapped an image in the ImageMessage.
Declaration
public event EventHandler<ImageTappedEventArgs> ImageTapped
Event Type
| Type |
|---|
| System.EventHandler<ImageTappedEventArgs> |
MessageDoubleTapped
Occurs when a message is double tapped in SfChat control.
Declaration
public event EventHandler<MessageDoubleTappedEventArgs> MessageDoubleTapped
Event Type
| Type |
|---|
| System.EventHandler<MessageDoubleTappedEventArgs> |
MessageLongPressed
Occurs when a message is long pressed/held in SfChat control.
Declaration
public event EventHandler<MessageLongPressedEventArgs> MessageLongPressed
Event Type
| Type |
|---|
| System.EventHandler<MessageLongPressedEventArgs> |
MessageTapped
Occurs when a message is tapped in SfChat control.
Declaration
public event EventHandler<MessageTappedEventArgs> MessageTapped
Event Type
| Type |
|---|
| System.EventHandler<MessageTappedEventArgs> |
Scrolled
Occurs when the SfChat control is scrolled.
Declaration
public event EventHandler<ChatScrolledEventArgs> Scrolled
Event Type
| Type |
|---|
| System.EventHandler<ChatScrolledEventArgs> |
SendMessage
Occurs when the a message is being sent.
Declaration
public event EventHandler<SendMessageEventArgs> SendMessage
Event Type
| Type |
|---|
| System.EventHandler<SendMessageEventArgs> |
SuggestionItemSelected
Occurs when the user selects an item in the suggestion list.
Declaration
public event EventHandler<SuggestionItemSelectedEventArgs> SuggestionItemSelected
Event Type
| Type |
|---|
| System.EventHandler<SuggestionItemSelectedEventArgs> |
SwipeEnded
Occurs when the swipe action is completed for a message.
Declaration
public event EventHandler<MessageSwipeEndedEventArgs> SwipeEnded
Event Type
| Type |
|---|
| System.EventHandler<MessageSwipeEndedEventArgs> |
SwipeStarted
Occurs when the user starts to swipe a message.
Declaration
public event EventHandler<MessageSwipeStartedEventArgs> SwipeStarted
Event Type
| Type |
|---|
| System.EventHandler<MessageSwipeStartedEventArgs> |
Swiping
Occurs when a message is currently being swiped.
Declaration
public event EventHandler<MessageSwipingEventArgs> Swiping
Event Type
| Type |
|---|
| System.EventHandler<MessageSwipingEventArgs> |