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; }
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; } }
// 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; } } }