public UserControlDashboard()
        {
            _viewModel  = new ImageResultViewModel();
            DataContext = _viewModel;
            InitializeComponent();

            /*   _tweetsResult.Add(new TweetsResult(){Tweet = "Nature",Uri = "localhost",User="******"});
             * _tweetsResult.Add(new TweetsResult(){Tweet = "Nature",Uri = "localhost",User="******"});
             * _tweetsResult.Add(new TweetsResult(){Tweet = "Nature",Uri = "localhost",User="******"});
             * _tweetsResult.Add(new TweetsResult(){Tweet = "Nature",Uri = "localhost",User="******"});
             * _tweetsResult.Add(new TweetsResult(){Tweet = "Nature",Uri = "localhost",User="******"});
             *
             * _imagesResult.Add(new ImagesResult("localhost/nature.jpg"));
             * _imagesResult.Add(new ImagesResult("localhost/nature.jpg"));*/
        }
        async void OpenAnalyzeImage(object sender, EventArgs args)
        {
            var page = new ImageCapturePage();
            var vm   = new ImageCaptureViewModel();

            vm.ImageConfirmed += async(image) =>
            {
                // Have the progress indicator displayed
                ViewModel.Analyzing = true;

                // Close the ImageCapturePage
                await Navigation.PopModalAsync();

                // Do analysis and display results page
                var tags = await VisionService.GetTagsAsync(image);

                var resultViewModel = new ImageResultViewModel
                {
                    Image       = image,
                    ImageSource = ImageSource.FromStream(image.GetStream),
                    Tags        = new ObservableCollection <ImageTag>(tags)
                };
                var resultPage = new ImageResultPage
                {
                    BindingContext = resultViewModel
                };

                await Navigation.PushAsync(resultPage);

                // Hide the progress indicator
                ViewModel.Analyzing = false;
            };

            page.BindingContext = vm;
            await Navigation.PushModalAsync(new NavigationPage(page));
        }
 public UserControlImageResult()
 {
     _viewModel  = new ImageResultViewModel();
     DataContext = _viewModel;
     InitializeComponent();
 }