Ejemplo n.º 1
0
        private async Task Analyze()
        {
            if (Photo == null || string.IsNullOrEmpty(pathImage) || pathImage == "default.jpg")
            {
                await Application.Current.MainPage.DisplayAlert("Xamarin Latino", "No has seleccionado una foto", "Ok");

                return;
            }

            IsBusy = true;
            try
            {
                var age = await service.DetectAge(pathImage);

                if (age > 0)
                {
                    this.Age = (int)age;
                }
            }
            catch
            {
                await Application.Current.MainPage.DisplayAlert("Xamarin Latino", "No se pudo evaluar la foto", "Ok");
            }
            IsBusy = false;
        }