コード例 #1
0
        public async Task ListFeaturedCollectionsTest()
        {
            var client = new UnsplasharpClient(Credentials.ApplicationId);
            var listFeaturedCollection = await client.ListFeaturedCollections();

            var listFeaturedCollectionPaged = await client.ListFeaturedCollections(2);

            Assert.IsNotNull(listFeaturedCollection);
            Assert.IsNotNull(listFeaturedCollectionPaged);

            Assert.IsTrue(listFeaturedCollection.Count > 0);
            Assert.IsTrue(listFeaturedCollectionPaged.Count > 0);
        }
コード例 #2
0
        public async Task LoadCollection()
        {
            FeaturedList.Clear();

            var client = new UnsplasharpClient(App.ServiceId);
            var listFeaturedCollection = await client.ListFeaturedCollections();

            foreach (var collection in listFeaturedCollection)
            {
                var newCollection = new CollectionModel
                {
                    CollectionId = collection.Id,
                    Title        = collection.Title,
                    Url          = collection.CoverPhoto.Urls.Small,
                    Description  = collection.Description,
                    Likes        = collection.CoverPhoto.Likes
                };

                FeaturedList.Add(newCollection);
            }
        }