New to Telerik UI for WPF? Download free 30-day trial

Show desktop alert with message in RadChat


Product RadChat for WPF


How to display alert, when a message is sent.


Handle the SendMessage event of the RadChat control, create a RadDesktopAlert and set its Content to a new MessageGroupViewModel. We are going to use the MessageGroup control to display the new message in the alert, however it can be replaced by a custom DataTemplate as well.

<Grid xmlns:telerik="" 
        <DataTemplate x:Key="ChatTemplate"> 
            <chat:MessageGroup /> 
    <telerik:RadChat x:Name="chat" SendMessage="chat_SendMessage" /> 

private void chat_SendMessage(object sender, SendMessageEventArgs e) 
    RadDesktopAlertManager manager = new RadDesktopAlertManager(AlertScreenPosition.BottomRight, new Point(0, 0), 10); 
    var chat = sender as RadChat; 
    var viewmodel = new MessageGroupViewModel(e.Message.Author); 
    viewmodel.Messages.Add((e.Message as IInlineMessage).InlineViewModel); 
    var alert = new RadDesktopAlert 
        Header = chat.CurrentAuthor.Name, 
        Content = viewmodel, 
        ContentTemplate = this.grid.FindResource("ChatTemplate") as DataTemplate, 
        ShowDuration = 5000, 

See Also

In this article