Exemplo n.º 1
0
        //private async void PageOnMap_Loaded(object sender, RoutedEventArgs e)
        private void PageOnMap_Loaded(object sender, RoutedEventArgs e)
        {
            Photoset ps = new Photoset();
            //List<Photoset> pList = await ps.getAllPhotosAMS();

            List <Photoset> pList = ps.getAllPhotos();

            preloader.Visibility = Visibility.Collapsed;

            foreach (Photoset p in pList)
            {
                MapIcon mapIcon1 = new MapIcon();

                BasicGeoposition a = new BasicGeoposition();
                a.Longitude       = p.Longitude;
                a.Latitude        = p.Latitude;
                mapIcon1.Location = new Geopoint(a);
                mapIcon1.NormalizedAnchorPoint = new Point(0.3, 0.3);
                mapDetail.Center = new Geopoint(a);
                mapIcon1.Title   = p.City;
                mapIcon1.Image   = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/pin.png"));
                mapIcon1.ZIndex  = 0;
                mapDetail.MapElements.Add(mapIcon1);
                mapDetail.MapElementClick += MapDetail_MapElementClick;
            }
            //mapDetail.Center = new Geopoint(new BasicGeoposition { Latitude = pList.Average(a=>a.Latitude), Longitude = pList.Average(a => a.Longitude)});
            mapDetail.Center = new Geopoint(new BasicGeoposition {
                Latitude = 36.654317, Longitude = 30.871094
            });
            mapDetail.ZoomLevel = 3;
        }
Exemplo n.º 2
0
        public Home()
        {
            InitializeComponent();

            Photoset ps = new Photoset();

            listviewPhotos.ItemsSource = ps.getAllPhotos();
        }
Exemplo n.º 3
0
        //  private IMobileServiceTable<Photoset> photosetTable = App.MobileService.GetTable<Photoset>();


        //private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            //Can Go back Feature
            //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;

            Photoset ps = new Photoset();

            //gridViewPhotos.ItemsSource = await ps.getAllPhotosAMS();

            gridViewPhotos.ItemsSource = ps.getAllPhotos();
            preloader.Visibility       = Visibility.Collapsed;

            //Device Family spesific features
            InitializeUi();
        }