예제 #1
0
        public async Task UploadPhoto()
        {
            if (IsBusy)
            {
                return;
            }

            try
            {
                IsBusy = true;

                var name       = imageName;
                var desc       = imageDesc;
                var currentloc = await gpsService.GetCurrentLocation();

                if (string.IsNullOrEmpty(name))
                {
                    dialogService.ShowError("Enter a photo name before uploading photo");
                    IsBusy = false;
                    return;
                }
                await mobileService.AddPhoto(photo, name, desc, currentloc);

                dialogService.ShowSuccess("File has been successfully uploaded!");
            }
            catch (Exception ex)
            {
                Debug.WriteLine("OH NO!" + ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        private async Task UploadPhoto()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            var name = imageName;
            var desc = imageDesc;

            if (string.IsNullOrEmpty(name))
            {
                dialogService.ShowError("Enter a photo name before uploading photo");
                IsBusy = false;
                return;
            }

            await mobileService.AddPhoto(photo, name, desc);

            dialogService.ShowSuccess("File has been successfully uploaded!");
            IsBusy = false;
        }