public void OnContactUpdate(Contact contact) { if (contact.IsOnline) { OfflineContacts.Remove(contact.Name); OnlineContacts.Add(contact.Name); } else { OnlineContacts.Remove(contact.Name); OfflineContacts.Add(contact.Name); } RaisePropertyChanged(nameof(OnlineContacts)); RaisePropertyChanged(nameof(OfflineContacts)); }
private void ReloadContacts() { OnlineContacts.Clear(); OfflineContacts.Clear(); foreach (var contact in ctx.Contacts) { if (contact.Value) { OnlineContacts.Add(contact.Key); } else { OfflineContacts.Add(contact.Key); } } RaisePropertyChanged(nameof(OnlineContacts)); RaisePropertyChanged(nameof(OfflineContacts)); }