Advertisement
Guest User

Untitled

a guest
May 29th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. StatusBar statusBar = StatusBar.GetForCurrentView();
  2. Musei muss;
  3. int IDmusei;
  4.  
  5. bool xy = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();
  6.  
  7. public ObservableCollection<Musei> Fav;
  8. ObservableCollection<Musei> favmuse = new ObservableCollection<Musei>();
  9.  
  10. protected override async void OnNavigatedTo(NavigationEventArgs e)
  11. {
  12.  
  13. //muss = (Musei)e.Parameter;
  14. //Lista Musei
  15. SQLiteAsyncConnection mussAll = new SQLiteAsyncConnection("DatabaseMusei.db");
  16. var queryAll = await mussAll.Table<Musei>().ToListAsync();
  17. IDmusei = (int)e.Parameter;
  18. muss = queryAll.Where(x => x.ID == IDmusei).FirstOrDefault();
  19.  
  20. //Deserializzazione Preferiti
  21. SQLiteAsyncConnection conn = new SQLiteAsyncConnection(Path.Combine(ApplicationData.Current.LocalFolder.Path, "Database.db"), true);
  22. await conn.CreateTableAsync<Musei>();
  23. var Dbase = Path.Combine(ApplicationData.Current.LocalFolder.Path, "Database.db");
  24. var con = new SQLiteAsyncConnection(Dbase, true);
  25. var query = await conn.Table<Musei>().ToListAsync();
  26. if (query.Any(x => x.ID == muss.ID))
  27. {
  28. CuorePieno.Visibility = Visibility.Visible;
  29. Cuore.Visibility = Visibility.Collapsed;
  30. }
  31.  
  32. //StatusBar
  33. statusBar.BackgroundColor = Colors.Brown;
  34. statusBar.BackgroundOpacity = 1;
  35. statusBar.ProgressIndicator.Text = "Sto caricando..";
  36. await statusBar.ProgressIndicator.ShowAsync();
  37.  
  38. //Controlla connessione ad internet
  39. if (xy == false)
  40. {
  41. string stringa = "Nessuna connessione ad internet trovate. Alcune funzionalità saranno disattivate.";
  42. MessageDialog dialogo = new MessageDialog(stringa);
  43. await dialogo.ShowAsync();
  44. }
  45.  
  46. //Nome Museo
  47. NameMuseo.Text = muss.NomeMuseo.ToUpper();
  48.  
  49. //Luogo
  50. if (muss.Luogopreciso != null)
  51. {
  52. Paese.Text = muss.Luogopreciso;
  53. }
  54. if (muss.Luogopreciso == null)
  55. {
  56. Paese.Text = muss.Paese;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement