예제 #1
0
        public PhotoControl(Photo photo)
        {
            this.InitializeComponent();

            double widh = Window.Current.Bounds.Width;

            this.Width = widh / 2;
            this.Height = widh / 2;

            grid.Width = this.Width;
            grid.Height = this.Height;
            BitmapImage bitmap = new BitmapImage(new Uri(photo.source,UriKind.RelativeOrAbsolute));
            img.Source = bitmap;
            title.Text = photo.title;


        }
예제 #2
0
        public async override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
        {

            if (navigationMode == NavigationMode.Back)
            {
                Listphoto = Statique.listphotodesc;
                SelectedPos = Statique.selectedpos;
                VisibleMap = Visibility.Visible;
                return;
            }


            string id = navigationParameter as string;
            selectedlocation = new Location();
            selectedphoto = Statique.listphotodesc.Where(x => x.id == id).ToList().FirstOrDefault();

            if(Statique.issearch)
            Listphoto = Statique.listphotodesc.Where(x=> x.search == true).ToList();
            else
            Listphoto = Statique.listphotodesc.Where(x => x.search == false).ToList();


            Statique.selectedpos = Listphoto.IndexOf(selectedphoto);
            SelectedPos = Statique.selectedpos;
            if ((selectedlocation = await _servicesPhoto.CheckforGeolocation(selectedphoto.id)) != null)
            {
                VisibleMap = Visibility.Visible;
            }
            else
            {
                VisibleMap = Visibility.Collapsed;

            }


        }
예제 #3
0
       // on swipping photo
        private async void OnPhotoChanged(SelectionChangedEventArgs obj)
         {
             if (obj.AddedItems.Count > 0)
             {
                  selectedphoto = obj.AddedItems[0] as Photo;
                  Statique.selectedpos = Statique.listphotodesc.IndexOf(selectedphoto);
                
                  if ((selectedlocation = await _servicesPhoto.CheckforGeolocation(selectedphoto.id)) != null)
                 {
                     VisibleMap = Visibility.Visible;

                 }
                 else
                 {
                     VisibleMap = Visibility.Collapsed;

                 }
                  
             }
         }