Telerik UI for Windows Phone by Progress

This topic explains how to get started with RadConversation and includes brief a explanation of the control's API.

Using RadConversationView

In the simplest case, using RadConversationView consists of instantiating a conversation view in XAML and binding it to a source of messages. By default, RadConversationView comes with a simple ConversationViewMessage class that provides the basic information that a text message contains. This is the message's text, its time stamp and the type of the message. The message type determines whether a message was sent or received. Below is a C# and XAML example of how to start using RadConversationView:

CopyXAML
<telerikDataControls:RadConversationView ItemsSource="{Binding}"
                                         x:Name="conversationView"/>
CopyC#
public partial class MainPage : PhoneApplicationPage
{
    ObservableCollection<ConversationViewMessage> messages = new ObservableCollection<ConversationViewMessage>();

    public MainPage()
    {
        InitializeComponent();

        ConversationViewMessage msg = new ConversationViewMessage("Hello.", DateTime.Now, ConversationViewMessageType.Outgoing);
        messages.Add(msg);

        msg = new ConversationViewMessage("Who's this?", DateTime.Now.AddSeconds(5), ConversationViewMessageType.Incoming);
        messages.Add(msg);

        msg = new ConversationViewMessage("This is aaah... Wikus van de Merwe from District 9. Hello Charlize.", DateTime.Now.AddSeconds(5), ConversationViewMessageType.Outgoing);
        messages.Add(msg);

        this.DataContext = messages;
    }
}