Ejemplo n.º 1
0
        //private async void Category_Clicked(object sender, ValueChangedEventArgs e)
        //{
        //    var jokeGenerator = new JokeGenerator.GetCategories();
        //    string joke = await jokeGenerator.GetCategories();
        //}

        private async void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            var    jokeGenerator = new JokeGenerator();
            string joke          = await jokeGenerator.GetRandomCategoryJoke(e.Item.ToString());

            await DisplayAlert("Joke", joke, "OK");
        }
Ejemplo n.º 2
0
        private async void JokeButton_Clicked(object sender, EventArgs e)
        {
            var    jokeGenerator = new JokeGenerator();
            string joke          = await jokeGenerator.GetRandomJoke();

            JokeLabel.Text = joke;
        }
Ejemplo n.º 3
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            var jokeGen = new JokeGenerator();

            Categories = await jokeGen.GetCategories();

            BindingContext = this;
        }