コード例 #1
0
        public async void GetReviewsByUser()
        {
            var list = await connectionHandler.DownloadReviewList();

            ReviewsList.Clear();

            foreach (var review in list)
            {
                var stream = await connectionHandler.DownloadThumbnail(review.id);

                using (var memoryStream = new MemoryStream())
                {
                    stream.CopyTo(memoryStream);
                    var bytes    = memoryStream.ToArray();
                    var imgSrc   = ImageSource.FromStream(() => new MemoryStream(bytes));
                    var menuItem = new ReviewMenuItem(review.id, review.userId, review.appId, review.category, review.temporalContext, review.spatialContext, review.socialContext, review.textReview, review.createdAt, review.updatedAt, review.imagePath, imgSrc);
                    ReviewsList.Add(menuItem);
                }
            }
        }