void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { ProgressIndicator.IsRunning = false; panelCargando.Visibility = System.Windows.Visibility.Collapsed; HtmlReader reader = new HtmlReader(e.Result.ToString()); // List<string> listaPeliculas = reader.listaPeliculas(); //cargarLista(listaPeliculas); ClassCinePlanet planet = reader.listaPeliculas(); List<string> listaIntercalada = planet.listaIntercalada(); for (int i = 0; i < listaIntercalada.Count; i++) { if (i % 2 == 0) { TextBlock txtTitulo = new TextBlock(); txtTitulo.FontSize = 25; txtTitulo.TextWrapping = TextWrapping.Wrap; txtTitulo.FontWeight = FontWeights.Bold; txtTitulo.Text = listaIntercalada.ElementAt(i); stackInfo.Children.Add(txtTitulo); } else { TextBlock txtInfo = new TextBlock(); txtInfo.FontWeight = FontWeights.Bold; txtInfo.TextWrapping = TextWrapping.Wrap; txtInfo.Text = listaIntercalada.ElementAt(i); stackInfo.Children.Add(txtInfo); } } //listaPeliculas.ItemsSource = planet.listaIntercalada(); }
void webClientDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { ProgressIndicator.IsRunning = false; panelCargando.Visibility = System.Windows.Visibility.Collapsed; HtmlReader reader = new HtmlReader(e.Result.ToString()); List<string> listaCines = reader.returnTablas(); int contador = 0; foreach (var item in listaCines) { String[] listaString = item.Split('\n'); StackPanel stack = new StackPanel(); int contador2 = 0; foreach (var item2 in listaString) { TextBlock texto = new TextBlock(); if (contador2 % 2 == 0) { texto.Text = item2; texto.FontSize = 25; texto.TextWrapping = TextWrapping.Wrap; } else { texto.Text = item2; texto.FontSize = 20; texto.TextWrapping = TextWrapping.Wrap; texto.FontWeight = FontWeights.Bold; } stack.Children.Add(texto); contador2++; } agregarStack(contador, stack); contador++; } }