/// <summary> /// Creates a new instance. /// </summary> /// <param name="category">The category to show data for.</param> /// <param name="photoThumbnail">The photo thumbnail that is used for /// determining the scroll position of the photo stream.</param> public StreamViewModelThumbnailArgs(CategoryPreview category, PhotoThumbnail photoThumbnail) { Category = category; PhotoThumbnail = photoThumbnail; }
/// <summary> /// Searches for a photo in the given photo list that matches the given /// photo thumbnail. /// </summary> /// <param name="photos">The photo list to search in.</param> /// <param name="photoThumbnail">The thumbnail to search for.</param> /// <returns>The photo that matches the given thumbnail.</returns> public static Photo FindPhotoForThumbnail(this IList<Photo> photos, PhotoThumbnail photoThumbnail) { return photos.FirstOrDefault(p => p.ThumbnailUrl.Equals(photoThumbnail.ImageUrl)); }
private void OnPhotoThumbnailSelected(PhotoThumbnail photoThumbnail) { var categoryPreview = TopCategories.SingleOrDefault(c => c.PhotoThumbnails.Contains(photoThumbnail)); if (categoryPreview != null) { _navigationFacade.NavigateToPhotoStream(categoryPreview, photoThumbnail); } }
/// <summary> /// Navigates to the photo stream view. /// </summary> /// <param name="categoryPreview">The category preview instance.</param> /// <param name="photoThumbnail"> /// The photo thumbnail that will determine the scroll position. /// </param> public void NavigateToPhotoStream(CategoryPreview categoryPreview, PhotoThumbnail photoThumbnail) { Navigate(typeof(StreamViewModel), new StreamViewModelThumbnailArgs(categoryPreview, photoThumbnail)); }