Ejemplo n.º 1
0
        public async Task GroupClicked(object sender, ItemClickEventArgs e)
        {
            Group2 group = e.ClickedItem as Group2;

            MyContacts.Clear();
            foreach (var contact in (await group.GetGroupContacts()).Contacts)
            {
                await client.SubscribeContactsChange(contact.Uri);

                LocalContact localContact = new LocalContact();
                localContact.Contact = contact;
                BitmapImage image     = new BitmapImage();
                var         imageData = await contact.GetContactPhoto();

                if (imageData != null)
                {
                    using (MemoryStream ms = new MemoryStream(imageData))
                    {
                        await image.SetSourceAsync(ms.AsRandomAccessStream());
                    }
                    localContact.ImageSource = image;
                }
                MyContacts.Add(localContact);
                if (contactMessages.Keys.Where(x => x.Uri == contact.Uri).FirstOrDefault() == null)
                {
                    contactMessages.Add(contact, new ObservableCollection <MessageDetail>());
                    contactConversations.Add(contact, null);
                }
            }
        }
 public void AddMyContract(EmergencyContactViewModel contact)
 {
     MyContacts.Add(contact);
     IsAnyMyCurrentAccessContacts = MyContacts.Any(c => c.AccessPeriodType == AccessPeriodType.FullAccess);
     IsAnyMyPendingContacts       = MyContacts.Any(c => c.IsPending);
     IsAnyMyEmergencyContacts     = MyContacts.Any(c => c.AccessPeriodType != AccessPeriodType.FullAccess && !c.IsPending);
     RaisePropertyChanged("MyContacts");
 }
Ejemplo n.º 3
0
 public void SetMyContacts(ViewContact value)
 {
     MyContacts.Add(value);
     NotifyStateChanged();
 }