Esempio n. 1
0
        public PhotoViewerPage(string photoUrl)
        {
            InitializeComponent();

            On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);

            viewModel = new PhotoViewerViewModel(photoUrl);

            BindingContext = viewModel;

            var tapped = new TapGestureRecognizer(async(arg1) =>
            {
                await DisplayAlert("Cog Services!", "We're going to analyze the image", "OK");

                if (!(arg1 is Image img))
                {
                    return;
                }

                if (!(img.Source is UriImageSource uri))
                {
                    return;
                }

                img.Source = ImageSource.FromUri(new Uri($"https://test-azuretour-imageanalyzer.azurewebsites.net/api/analyzeimage?url={uri.Uri.AbsoluteUri}"));
            });

            tapped.NumberOfTapsRequired = 5;
            detailImage.GestureRecognizers.Add(tapped);
        }
Esempio n. 2
0
        public PhotoViewerPage(string photoUrl)
        {
            InitializeComponent();

            viewModel = new PhotoViewerViewModel(photoUrl);

            BindingContext = viewModel;
        }
        public PhotoViewerPage(string photoUrl)
        {
            InitializeComponent();

            On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);

            viewModel = new PhotoViewerViewModel(photoUrl);

            BindingContext = viewModel;
        }