internal void Update(Match[] matches) { lock (_matches) { foreach (var match in matches) { var existingMatch = _matches.FirstOrDefault(a => a.Data.Id == match.Id); if (existingMatch != null) { foreach (var msg in match.Messages) existingMatch.Messages.Add(new ConversationMessageViewModel(msg)); } else { _matches.Insert(0, new MatchViewModel(match)); } } RaisePropertyChanged("Matches"); } }
public MatchViewModel(Match data) { _data = data; }