Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System.Collections.ObjectModel;
  2.  
  3. using Xamarin.Forms;
  4. using Xamarin.Forms.Xaml;
  5.  
  6. namespace Pj4.Views
  7. {
  8.     [XamlCompilation(XamlCompilationOptions.Compile)]
  9.     public partial class LocationsPage : ContentPage
  10.     {
  11.         public LocationsPage()
  12.         {
  13.             InitializeComponent();
  14.  
  15.             Locations l = new Locations();
  16.  
  17.             ObservableCollection<Locations> LocationList = new ObservableCollection<Locations>();
  18.             LocationView.ItemsSource = LocationList;
  19.  
  20.             foreach (Location loc in l.GetLocations())
  21.             {
  22.                 LocationList.Add(new Locations() { name = loc.name });
  23.             }
  24.             LocationView.ItemsSource = LocationList;
  25.         }
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement