Dear All,
I am new to Chat control. I am practicing RadChat in Chat application, such that I have list of contacts on Left side, which bounded to List of users where
public
class
User: Entity
{
public
ObservableCollection<MessageBase> Messages {
get
=> messages;
set
{ messages = value; RaisePropertyChange(); } }
}
I have bounded RadChat DataSource as SelectedUser.Messages property, where SelectedUser is public property in my viewmodel, which contains selected item object.
As I assume that RadChat need to updated Messages as datasource is changed, but instead of refreshing messages, it appends new messages to old one.
My requirement is to Clear all messages in Chat UI, as I have selected new Messages object as datasource.
Here I want to clarify that data in Messages are correct according to my need. I feel it is some issue in RadChat or I need further steps to acheive my target.
<
telerik:RadChat
Grid.Row
=
"2"
Margin
=
"5 0 0 0"
Name
=
"ctrlChat"
CurrentAuthor
=
"{Binding CurrentAuther,UpdateSourceTrigger=PropertyChanged}"
DataSource
=
"{Binding SelectedUser.Messages, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
>
<
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:EventBinding
EventName
=
"SendMessage"
Command
=
"{Binding SendMessageCommand}"
PassEventArgsToCommand
=
"True"
/>
</
telerik:EventToCommandBehavior.EventBindings
>
</
telerik:RadChat
>