async void ButtonRandom_ClickedAsync(object sender, EventArgs e)
        {
            int randomNumber = new Random().Next(1, 72);
            GoetiaDetailContentPage destinationCP = new GoetiaDetailContentPage(randomNumber);

            await this.Navigation.PushAsync(destinationCP);
        }
示例#2
0
        private void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            ImageLabelViewModel item = (ImageLabelViewModel)e.Item;

            GoetiaDetailContentPage destinationCP = new GoetiaDetailContentPage(item.ID);

            this.Navigation.PushAsync(destinationCP);

            // deselect
            ((ListView)sender).SelectedItem = null;
        }
        private async void PerformSearch()
        {
            this.CustomActivityIndicator.IsRunning = true;
            var results = await ViewModel.SearchWithText(ViewModel.SearchText);

            if (results.Count == 1)
            {
                GoetiaDetailContentPage destinationCP = new GoetiaDetailContentPage(results.FirstOrDefault());
                await this.Navigation.PushAsync(destinationCP);
            }
            else if (results.Count > 1)
            {
                await Navigation.PushAsync(new GoetiaListContentPage(results));
            }
            else
            {
                await DisplayAlert("Search", "No result. Please try a different keyword search", "OK");
            }
            this.CustomActivityIndicator.IsRunning = false;
        }