Accessing and Customizing Elements
RadChat is virtualized and the displayed messages can be accessed in the RadChat.ItemFormatting event.
The structure articles provides detailed information about the element hierarchy building the visual tree of the control.
RadChat is working with four different elements visually representing a message:
TextMessageItemElement: Represents a single message item consisting of text.
MediaMessageItemElement: Represents a single message item consisting of an image.
-
CardMessageItemElement: A single message item presented in a card. The card item can have:
ChatImageCardElement: A card element with an image.
ChatFlightCardElement: Predefined card element providing flight information.
ChatProductCardElement: Predefined card element providing product information.
ChatWeatherCardElement: Predefined card element providing weather information.
CarouselMessageItemElement: Item element consisting of a horizontal stack which can be populated with Image, Flight, Product, and Weather cards.
The chat toolbar and input text box are exposed as properties and they can be accessed through the RadChatElement object: RadChat.ChatElement.InputTextBox, RadChat.ChatElement.ToolbarElement.
ItemFormatting Event
The ItemFormatting event can be used to access and change the styling of the message item elements.
Due to the UI virtualization, the event needs to be handled with an if-else statement so that the applied settings are reset for elements which will not be customized.
Customizing The Main Item Elements
Figure 1: Text and Media Items
Figure 2: Card Items
Figure 3: Carousel Item
Customizing the Child Items
Figure 4: Customizing the Child Elements