Exemple #1
0
 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));
 }
Exemple #2
0
        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));
        }