New to Telerik UI for WinForms? Start a free 30-day trial

Creates the data items and visual elements used to represent RadChat messages and actions.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class ChatFactory

Inheritance: objectChatFactory

Constructors

C#
public ChatFactory()

Methods

Creates the built-in visual element corresponding to a supported chat card data item.

C#
public virtual BaseChatCardElement CreateCardElement(BaseChatCardDataItem cardDataItem)
Parameters:cardDataItemBaseChatCardDataItem

An instance whose runtime type is exactly ChatFlightCardDataItem, ChatImageCardDataItem, ChatProductCardDataItem, or ChatWeatherCardDataItem.

Returns:

BaseChatCardElement

The matching card element, or null when the data item's type has no built-in mapping.

The built-in mappings use exact runtime-type checks; derived or custom card data-item types require an override.

Creates the data-item adapter for a supported chat message.

C#
public virtual BaseChatDataItem CreateDataItem(ChatMessage message)
Parameters:messageChatMessage

The message to adapt.

Returns:

BaseChatDataItem

The matching data item, or null when the message type has no built-in mapping.

The built-in mapping accepts instances of the supported message types, including derived types.

Creates the standard virtualized item element for a supported chat data-item type.

C#
public virtual BaseChatItemElement CreateItemElement(BaseChatDataItem item)
Parameters:itemBaseChatDataItem

The data item whose message visual is being created.

Returns:

BaseChatItemElement

The matching item element, or null when no built-in mapping exists.

The built-in mapping uses assignability for AIChatMessageDataItem and exact runtime types for the other supported data items.

Creates the standard visual element for a suggested action.

C#
public virtual SuggestedActionElement CreateSuggestedActionElement(SuggestedActionDataItem item)
Parameters:itemSuggestedActionDataItem

The suggested-action data represented by the element.

Returns:

SuggestedActionElement

A suggested-action element bound to item.

Creates the standard visual element for a toolbar action.

C#
public virtual ToolbarActionElement CreateToolbarActionElement(ToolbarActionDataItem item)
Parameters:itemToolbarActionDataItem

The toolbar action data represented by the element.

Returns:

ToolbarActionElement

A toolbar action element bound to item.