New to Telerik UI for .NET MAUIStart a free 30-day trial

Interface that defines how chat items should be converted.

Definition

Namespace:Telerik.Maui.Controls.Chat

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public interface IChatItemConverter

Methods

Converts a data item to a chat item. In general here you need to create and set up the corresponding ChatItem for the given business object.

C#
ChatItem ConvertToChatItem(object dataItem, ChatItemConverterContext context)
Parameters:dataItemobject

The item to be converted.

contextChatItemConverterContext

The respective ChatItemConverterContext.

Returns:

ChatItem

An ChatItem instance.

Converts a message to a data item. In general here you need to create an instance of your business object that the RadChat will try to add automatically to the ItemsSource collection. Usually the message is the string from the entry in the chat, and this method is invoked when the Send button is pressed.

C#
object ConvertToDataItem(object message, ChatItemConverterContext context)
Parameters:messageobject

The message to be converted.

contextChatItemConverterContext

The respective ChatItemConverterContext.

Returns:

object

The corresponding data item.