Subversion Repository Public Repository

Nextrek

Diff Revisions 34 vs 35 for /WindowsPhone/NotizieTL/NotizieTL/MainPage.xaml.cs

Diff revisions: vs.
  @@ -61,6 +61,10 @@
61 61 // to leave a stream open, and we will not need to worry about closing the channel.
62 62 webClient1.DownloadStringAsync(new System.Uri("http://tuttolavoro.indicitalia.it/RSS/app.xml"));
63 63 webClient3.DownloadStringAsync(new System.Uri("http://www.wki.it/marketing/app/tuttolavoroApp_Rel_news.xml"));
64 +
65 +
66 + //if (listArticoliP.Count == 0)
67 + // feedListPreferiti.Visibility = System.Windows.Visibility.Collapsed;
64 68 }
65 69
66 70 // Click handler that runs when the 'Load Feed' or 'Refresh Feed' button is clicked.
  @@ -285,7 +289,7 @@
285 289
286 290 // The SelectionChanged handler for the feed items
287 291 private void feedListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
288 - {
292 + {
289 293 ListBox listBox = sender as ListBox;
290 294
291 295 if (listBox != null && listBox.SelectedItem != null)
  @@ -350,39 +354,84 @@
350 354
351 355 private void MenuItem_Click(object sender, RoutedEventArgs e)
352 356 {
353 -
357 +
354 358 feedListPreferiti.ItemsSource = listArticoliP;
355 359
356 360 }
357 361
358 362 private void feedListBoxNews1_Hold(object sender, System.Windows.Input.GestureEventArgs e)
359 363 {
360 - ListBox listBox = sender as ListBox;
361 - bool a = (listBox.SelectedItem != null);
362 - bool b = true;
364 + // ListBox listBox = sender as ListBox;
365 + // bool a = (listBox.SelectedItem != null);
366 + // bool b = true;
363 367
364 368
365 369
366 - if (listBox != null && listBox.SelectedItem != null)
370 + // if (listBox != null && listBox.SelectedItem != null)
371 + // {
372 + // // Get the SyndicationItem that was tapped.
373 + // Articolo sItem = (Articolo)listBox.SelectedItem;
374 +
375 + // String ti = sItem.Titolo;
376 + // String te = sItem.Testo;
377 + // String l = sItem.Link;
378 + // String d = sItem.DataPub;
379 + // Boolean isC = false;
380 +
381 + // ArticoloPreferito ap = new ArticoloPreferito(ti, te, l, d, isC);
382 + // listArticoliP.Add(ap);
383 +
384 +
385 + // }
386 + }
387 +
388 + private void appBarDelete_Click(object sender, EventArgs e)
389 + {
390 + if (listArticoliP.Count != 0)
367 391 {
368 - // Get the SyndicationItem that was tapped.
369 - Articolo sItem = (Articolo)listBox.SelectedItem;
392 + foreach (ArticoloPreferito a in listArticoliP)
393 + {
394 + if (a.IsChecked == true)
395 + {
396 + listArticoliP.Remove(a);
397 + }
398 + }
399 + }
400 + }
370 401
371 - String ti = sItem.Titolo;
372 - String te = sItem.Testo;
373 - String l = sItem.Link;
374 - String d = sItem.DataPub;
375 - Boolean isC = false;
402 + private void appBarRefresh_Click(object sender, EventArgs e)
403 + {
404 +
405 + }
376 406
377 - ArticoloPreferito ap = new ArticoloPreferito(ti, te, l, d, isC);
378 - listArticoliP.Add(ap);
407 + private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
408 + {
409 +
379 410
411 + if (pivot.SelectedIndex == 0 || pivot.SelectedIndex == 2)
412 + {
413 + ApplicationBar.IsVisible = false;
380 414
381 415 }
416 + else
417 + {
418 + ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
419 + ApplicationBar.IsVisible = true;
420 +
421 + try
422 + {
423 + appBarDelete.IsEnabled = false;
424 + }
425 + catch { }
426 + }
427 +
428 +
382 429 }
383 430
384 431
385 432
433 +
434 +
386 435
387 436 }
388 437 }