Class ChatMessageTemplateSelector
Provides override methods to load a custom template for messages based on its type.
Inheritance
System.Object
ChatMessageTemplateSelector
Namespace: Syncfusion.Maui.Chat
Assembly: Syncfusion.Maui.Chat.dll
Syntax
public class ChatMessageTemplateSelector : DataTemplateSelector
Constructors
ChatMessageTemplateSelector(SfChat)
Initializes a new instance of the ChatMessageTemplateSelector class.
Declaration
public ChatMessageTemplateSelector(SfChat chat)
Parameters
Type | Name | Description |
---|---|---|
SfChat | chat | The instance of the SfChat control. |
Methods
OnSelectTemplate(Object, BindableObject)
Returns the required template based on the message type.
Declaration
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The actual message as System.Object. |
Microsoft.Maui.Controls.BindableObject | container | The actual row data as Microsoft.Maui.Controls.BindableObject. |
Returns
Type | Description |
---|---|
Microsoft.Maui.Controls.DataTemplate | A developer-defined Microsoft.Maui.Controls.DataTemplate that can be used to display a message. |