# Overview

**RadChat** provides a predefined set of message types. They all have some common functionality which is derived from the **MessageBase** class. All messages have an **Author** and **CreationDate**. The message value is dependent on the given message type so it is not common for all messages.

## Adding the Message

Adding a given message is done through the **AddMessage** method of **RadChat**. It has the following two overloads.

* **(MessageBase message)**: pass the already defined type of message.
* **(Author author, string message)**: pass directly the string message and its **Author**. The control will internally wrap the string value into a **TextMessage**.

## Sending the Message

When sending a message the **SendMessage** event will be triggered. Its arguments expose the **Message** property through which the message that is currently being sent can be customized.

**Handling the SendMessage Event**

```C#
private void Chat_SendMessage_(object sender, SendMessageEventArgs e)
{
    var author = e.Message.Author;
    if (author == this.chat.CurrentAuthor)
    {
        this.chat.AddMessage(this.currentAuthor, (e.Message as TextMessage).Text);
        this.chat.AddMessage(this.otherAuthor, this.messageHelper.RecieveMessage(e.Message));

        e.Handled = true;
    }
}
```

## Display Position

Depending on the type of the given message, it can have a different value for its **MessageDisplayPosition** property. This is an enumeration that can have one of the following values.

* **Inline**
* **Popup**
* **Overlay**

For demonstrating the different **DisplayPositions**, a sample **CalendarMessage** will be used.

> caption Inline DisplayPosition

![Inline DisplayPosition](https://www.telerik.com/products/wpf/documentation/assets/7446ad69cb16b53a061a4d60f7e7d1c3/radchat_messages_overview_01.png)

> caption Popup DisplayPosition

![Popup DisplayPosition](https://www.telerik.com/products/wpf/documentation/assets/e0f40739be193e053d8306c92516b2d9/radchat_messages_overview_02.png)

> caption Overlay DisplayPosition

![Overlay DisplayPosition](https://www.telerik.com/products/wpf/documentation/assets/2e910e18b653749f397882fdcc6d631a/radchat_messages_overview_03.png)

Note, that some message types support modifying their display position, whereas other ones have a fixed value which cannot be controlled.

### Messages that can have their Display Position set

* [CalendarMessage](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/calendarmessage)
* [ListMessage](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/listmessage)
* [DataFormMessage](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/dataformmessage)
* [CarouselMessage](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/carouselmessage)

## Cards

**RadChat** provides mechanism for displaying more complex information in a user-friendly structured manner and allowing the user to interact with it. This is done through the Card Messages. A built-in set of cards is defined to choose from depending on the data that is to be displayed.

* [CardMessage](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/card-messages/cardmessage)
* [ImageCard](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/card-messages/imagecard)
* [ProductCard](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/card-messages/productcard)
* [FlightCards](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/card-messages/flightcard)
* [WeatherCards](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/card-messages/weathercard)

## See Also

* [Text Message](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/textmessage)
