Ejemplo n.º 1
0
        private async Task <List <UserFeedViewModel> > createUserListView(IEnumerable <User> list)
        {
            List <UserFeedViewModel> feedViewList = new List <UserFeedViewModel>();

            foreach (User x in list)
            {
                UserFeedViewModel listElement = new UserFeedViewModel();

                listElement.Id   = x.Id;
                listElement.Name = String.Format("{0} {1}", x.FirstName, x.LastName);

                byte[] itemImageBytes = await ImageManager.GetProfilePicture(x.UserId);

                listElement.ImageSource = "minrva_icon.png";

                if (itemImageBytes != null)
                {
                    listElement.ImageSource = ImageSource.FromStream(() => new MemoryStream(itemImageBytes));
                }

                feedViewList.Add(listElement);
            }

            return(feedViewList);
        }
Ejemplo n.º 2
0
        async Task displayProfilePicture()
        {
            var imageBytes = await ImageManager.GetProfilePicture(sid);

            if (imageBytes == null)
            {
                ProfilePicture.Source = "minrva_icon.png";
            }
            else
            {
                ProfilePicture.Source = ImageSource.FromStream(() =>
                                                               new MemoryStream(imageBytes));
            }
        }
Ejemplo n.º 3
0
        private async void displayProfilePicture()
        {
            var imageBytes = await ImageManager.GetProfilePicture(profOwner.UserId);

            if (imageBytes == null)
            {
                ProfilePicture.Source = "minrva_icon.png";
            }
            else
            {
                ProfilePicture.Source = ImageSource.FromStream(() =>
                                                               new MemoryStream(imageBytes));
            }
        }