waypoint.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. using Windows.Devices.Geolocation;
  7. namespace Breda_Tour.Data
  8. {
  9. class Waypoint
  10. {
  11. public Geopoint Position { 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.Position = new Geopoint(new BasicGeoposition() { Altitude = 0, Latitude = Lat, Longitude = Long });
  18. this.Title = Title;
  19. this.Description = Description;
  20. this.Photos = new List<Image>();
  21. if (pictures != null)
  22. {
  23. Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
  24. {
  25. foreach (string source in pictures)
  26. {
  27. Photos.Add(new Image
  28. {
  29. Source = new BitmapImage(new Uri("file://Storages/images/" + source)),
  30. Name = source
  31. });
  32. }
  33. });
  34. }
  35. }
  36. }
  37. }