Ejemplo n.º 1
0
        public static List <GroupedCategoryPreview> GetTopCategories()
        {
            var mockPhotoThumbnail = new PhotoThumbnail {
                ImageUrl = mockImageUrl
            };
            var thumbnailList = new List <PhotoThumbnail>();

            for (var i = 0; i < 6; i++)
            {
                thumbnailList.Add(mockPhotoThumbnail);
            }

            var mockCategory = new CategoryPreview
            {
                Name            = "",
                PhotoThumbnails = thumbnailList
            };

            var list = new List <GroupedCategoryPreview>();

            for (var i = 0; i < 8; i++)
            {
                list.Add(new GroupedCategoryPreview(thumbnailList, "", "", mockCategory));
            }

            return(list);
        }
 /// <summary>
 /// Navigates to the upload view.
 /// </summary>
 /// <param name="image">The image to upload.</param>
 /// <param name="category">The category to upload the image into.</param>
 public void NavigateToUploadView(WriteableBitmap image, CategoryPreview category)
 {
     Navigate(typeof(UploadViewModel), new UploadViewModelArgs
     {
         Category = category,
         Image    = image
     }, false);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Converts from <see cref="CategoryPreview" /> to <see cref="Category" />.
 /// </summary>
 /// <param name="categoryPreview">The category preview object.</param>
 /// <returns>The category.</returns>
 public static Category ToCategory(this CategoryPreview categoryPreview)
 {
     return(new Category
     {
         Id = categoryPreview.Id,
         Name = categoryPreview.Name
     });
 }
 /// <summary>
 /// Navigates to the crop view.
 /// </summary>
 /// <param name="file">The photo to crop.</param>
 /// <param name="category">The selected category for the photo.</param>
 public void NavigateToCropView(StorageFile file, CategoryPreview category)
 {
     Navigate(typeof(CropViewModel), new CropViewModelArgs
     {
         Category    = category,
         StorageFile = file
     }, false);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Converts the given category preview data model to a contract.
 /// </summary>
 /// <param name="category">The category preview data model.</param>
 /// <returns>The category preview contract.</returns>
 public static CategoryPreviewContract ToDataContract(this CategoryPreview category)
 {
     return(new CategoryPreviewContract
     {
         Id = category.Id,
         Name = category.Name,
         PhotoThumbnails = category.PhotoThumbnails.Select(t => t.ToDataContract()).ToList()
     });
 }
        public void Init(CategoryPreview categoryPreview)
        {
            categoryId = categoryPreview.Id;
            Title      = categoryPreview.Name;


            IsLoaded = false;

            // Mock data
            Photos.ReplaceRange(MockData.GetHeroImages());
        }
        private void OnCategorySelected(CategoryPreview categoryPreview)
        {
            _telemetryClient.TrackEvent(TelemetryEvents.CategoryPreviewSelected, new Dictionary <string, string>
            {
                {
                    TelemetryProperties.CategoryName, categoryPreview.Name
                }
            });

            SelectedCategoryPreview = categoryPreview;
            _navigationFacade.NavigateToPhotoStream(categoryPreview);
        }
        /// <summary>
        /// Creates a new category.
        /// </summary>
        /// <param name="categoryName">The category name.</param>
        /// <returns>The category.</returns>
        public async Task <Category> CreateCategory(string categoryName)
        {
            await SimulateWaitAndError();

            var categoryPreview = new CategoryPreview
            {
                Id              = Guid.NewGuid().ToString(),
                Name            = categoryName,
                PhotoThumbnails = new List <PhotoThumbnail>()
            };

            TopCategories.Add(categoryPreview);

            return(categoryPreview.ToCategory());
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="category">The category to show data for.</param>
 public StreamViewModelArgs(CategoryPreview category)
 {
     Category = category;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PhotoDetailsViewModelArgs" /> class.
 /// </summary>
 /// <param name="category">The category.</param>
 /// <param name="photo">The photo.</param>
 public PhotoDetailsViewModelArgs(CategoryPreview category, Photo photo)
 {
     Category = category;
     Photo    = photo;
 }
Ejemplo n.º 11
0
 public CategoryThumbnailBundle(CategoryPreview preview, PhotoThumbnail thumbnail)
 {
     this.Preview   = preview;
     this.Thumbnail = thumbnail;
 }
Ejemplo n.º 12
0
 private void OnCategorySelected(CategoryPreview categoryPreview)
 {
     SelectedCategoryPreview = categoryPreview;
     _navigationFacade.NavigateToPhotoStream(categoryPreview);
 }
Ejemplo n.º 13
0
 /// <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));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Navigates to the photo stream view.
 /// </summary>
 /// <param name="category">The category preview instance.</param>
 public void NavigateToPhotoStream(CategoryPreview category)
 {
     Navigate(typeof(StreamViewModel), new StreamViewModelArgs(category));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Navigates to the photo details view.
 /// </summary>
 /// <param name="category">The category.</param>
 /// <param name="photo">The photo.</param>
 public void NavigateToPhotoDetailsView(CategoryPreview category, Photo photo)
 {
     Navigate(typeof(PhotoDetailsViewModel), new PhotoDetailsViewModelArgs(category, photo));
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Navigates to the camera view.
 /// </summary>
 /// <param name="category">The category.</param>
 public void NavigateToCameraView(CategoryPreview category)
 {
     Navigate(typeof(CameraViewModel), new CameraViewModelArgs(category));
 }
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="category">The target category for the photo.</param>
 public CameraViewModelArgs(CategoryPreview category)
 {
     Category = category;
 }
 /// <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;
 }
 public GroupedCategoryPreview(IEnumerable <PhotoThumbnail> items, string name, string shortName, CategoryPreview categoryPreview) : base(items, name, shortName)
 {
     this.CategoryPreview = categoryPreview;
 }