コード例 #1
0
        private async void AdapterOnPhotoUpdated(object sender, CustomerPhotoUpdatedEvent e)
        {
            CustomerPhotoViewModel vm = this.ViewModel as CustomerPhotoViewModel;

            if (vm == null)
            {
                return;
            }

            vm.PhotoUpdated(e.Position);

            // serialize the selected photo and pass it's string to the Photo Upload service
            CustomerPhoto photo     = vm.CustomerPhotos[e.Position];
            var           photoList = new List <CustomerPhoto> {
                photo
            };
            var photoListString = JsonConvert.SerializeObject(photoList);

            Logger.Verbose(photoListString);

            var photoUploadServiceIntent = new Intent(Activity, typeof(CustomerPhotoUploadService));

            photoUploadServiceIntent.PutExtra(CustomerPhotoUploadService.PhotoList, photoListString);

            Activity.StartService(photoUploadServiceIntent);
        }
コード例 #2
0
        private void UploadStatusEvent(object sender, UploadStatusEventArgs e)
        {
            CustomerPhotoViewModel vm = this.ViewModel as CustomerPhotoViewModel;

            if (e.PhotoUploadStatusDictionary == null || vm == null)
            {
                return;
            }

            foreach (var map in e.PhotoUploadStatusDictionary)
            {
                CustomerPhoto photo = new CustomerPhoto
                {
                    Id = map.Key,
                    PhotoUploadStatus = map.Value
                };

                vm.PhotoUpdated(photo);
            }
        }