waypoint.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using Windows.UI.Xaml.Media.Imaging;
  4. using Windows.UI.Core;
  5. using Windows.UI.Xaml.Controls;
  6. namespace Breda_Tour.Data
  7. {
  8. class Waypoint
  9. {
  10. public float Lat { get; private set; }
  11. public float Long { get; private set; }
  12. public String Title { get; private set; }
  13. public String Description { get; private set; }
  14. public List<Image> Photos { get; private set; }
  15. public Waypoint(float Lat, float Long, String Title, String Description, List<string> pictures)
  16. {
  17. this.Lat = Lat;
  18. this.Long = Long;
  19. this.Title = Title;
  20. this.Description = Description;
  21. this.Photos = new List<Image>();
  22. if (pictures != null)
  23. {
  24. Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
  25. {
  26. foreach (string source in pictures)
  27. {
  28. Photos.Add(new Image
  29. {
  30. Source = new BitmapImage(new Uri("file://Storages/images/" + source)),
  31. Name = source
  32. });
  33. }
  34. foreach (Image i in Photos)
  35. {
  36. System.Diagnostics.Debug.WriteLine(i.Name);
  37. }
  38. });
  39. }
  40. }
  41. }
  42. }