Пример #1
0
        async void NewPerson(NewPersonMessage newPersonMessage)
        {
            var cp = new ContactPicker();

            var ci = await cp.PickSingleContactAsync();

            if (ci != null)
            {
                var model = new PersonOverViewModel()
                {
                    Name = ci.Name
                };
                Items.Add(model);

                var stream = await ci.GetThumbnailAsync();

                if (stream.Size == 0)
                {
                    stream = await GetCameraStream();
                }
                if (stream.Size != 0)
                {
                    await _storeImages.StorePersonImage(stream, model.Id);

                    model.ImageId = model.Id;
                }
            }
        }
Пример #2
0
        private async void btnContact_Click(object sender, RoutedEventArgs e)
        {
            Details = new List <ContactDetails>();
            var p = new ContactPicker();

            p.CommitButtonText = "Pick Contact";
            var selectedContact = await p.PickSingleContactAsync();

            Details.Add(new ContactDetails(selectedContact));
            lstContact.ItemsSource = Details;
        }