示例#1
0
        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");
            }
        }
示例#2
0
 public MatchViewModel(Match data)
 {
     _data = data;
 }