private void AddToModelRbMessages(List <Rainbow.Model.Message> rbMessagesList) { List <InstantMessaging.Model.Message> messagesList = new List <InstantMessaging.Model.Message>(); foreach (Rainbow.Model.Message rbMessage in rbMessagesList) { InstantMessaging.Model.Message msg = GetMessageFromRBMessage(rbMessage, rbConversation.Type); if (msg != null) { messagesList.Insert(0, msg); msg.AvatarSource = Helper.GetContactAvatarImageSource(msg.PeerId); } } lock (lockObservableMessagesList) { if (MessagesList.Count == 0) { MessagesList.ReplaceRange(messagesList); } else { MessagesList.AddRange(messagesList, System.Collections.Specialized.NotifyCollectionChangedAction.Reset, 0); } } }