コード例 #1
0
        protected override async Task RefreshList()
        {
            try
            {
                RaiseStartRefreshList();

                Items.Clear();
                var list = await FriendsAPI.GetExtendedAsync(
                    new[] { FriendsAPI.FieldsEnum.photo_50, FriendsAPI.FieldsEnum.online });

                if (list == null)
                {
                    return;
                }

                foreach (var item in list.Items)
                {
                    Items.Add(new VCAListItem <VKFriend>(item));
                }
            }
            catch (NullReferenceException)
            {
            }
            finally
            {
                RaiseFinishRefreshList();
            }
        }
コード例 #2
0
        protected override async Task <IEnumerable <VKFriend> > RefreshCore()
        {
            var list = await VKApi.Audio.GetBroadcastListAsync(VKBroadcastFilterEnum.All);

            var friendList = await FriendsAPI.GetExtendedAsync(new[] { FriendsAPI.FieldsEnum.photo_50 });

            Debug.Assert(list != null);
            Debug.Assert(friendList != null);

            list.Items.ForEach(b =>
            {
                var friend = friendList.Items.FirstOrDefault(v => v.Id == b.Id);
                if (friend != null)
                {
                    b.Photo50 = friend.Photo50;
                }
            });

            return(list.Items);
        }