Beispiel #1
0
 private void OnContactPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "IsFavorite" && ActiveTab == 1)
     {
         ContactsListView.Refresh();
     }
 }
Beispiel #2
0
        private void ContactChanged(object sender, ContactEventArgs e)
        {
            if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.ContactChanged(sender, e)));
                return;
            }

            if (ContactsListView != null)
            {
                ContactsListView.Refresh();
            }
        }
 protected override void RefreshContactsList()
 {
     //****************************************************************************************
     // Refresh the contact list of Chat.
     //*****************************************************************************************
     try
     {
         if (ContactsListView != null && ContactsListView.SourceCollection != null)
         {
             ContactsListView.Refresh();
         }
     }
     catch (Exception)
     {
     }
     OnPropertyChanged("ContactsListView");
 }
Beispiel #4
0
 private void RemoveContactModel(ContactID contactID)
 {
     //*************************************************************************************************************************************************
     // Remove contact and update contact list.
     //*************************************************************************************************************************************************
     lock (this.Contacts)
     {
         foreach (var contact in Contacts)
         {
             if (contact.Contact == contactID)
             {
                 contact.PropertyChanged -= OnContactPropertyChanged;
                 Contacts.Remove(contact);
                 ContactsListView.Refresh();
                 break;
             }
         }
     }
 }
Beispiel #5
0
        private void AddContact(VATRPContact contact, bool refreshNow = false)
        {
            if (!contact.SipUsername.NotBlank() || !contact.IsLinphoneContact)
            {
                return;
            }

            if (FindContact(contact) != null)
            {
                return;
            }

            lock (this.Contacts)
            {
                contact.PropertyChanged += OnContactPropertyChanged;
                Contacts.Add(new ContactViewModel(contact));
            }

            if (refreshNow)
            {
                ContactsListView.Refresh();
            }
        }