Пример #1
0
        /// <summary>
        /// 点击加载更多
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void loading_more_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (_unbinding_busy)
                return;
            _unbinding_busy = true;
            (sender as ListViewItem).Content = "正在加载...";

            List<CNBlog> loading_item = await BlogService.GetRecentBlogsAsync(_unbinding_current_page, 20);
            if (loading_item != null)
            {
                loading_item.ForEach((blog) =>
                {
                    CNBlogItem item = new CNBlogItem(blog);
                    UnBindingListView.Items.Insert(UnBindingListView.Items.Count - 1, item);
                });
                _unbinding_current_page++;
                UnBindingListView.ScrollIntoView(sender);
            }
            (sender as ListViewItem).Content = "点击加载更多...";
            _unbinding_busy = false;
        }
Пример #2
0
        /// <summary>
        /// 点击加载更多
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void loading_more_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (_unbinding_busy)
            {
                return;
            }
            _unbinding_busy = true;
            (sender as ListViewItem).Content = "正在加载...";

            List <CNBlog> loading_item = await BlogService.GetRecentBlogsAsync(_unbinding_current_page, 20);

            if (loading_item != null)
            {
                loading_item.ForEach((blog) =>
                {
                    CNBlogItem item = new CNBlogItem(blog);
                    UnBindingListView.Items.Insert(UnBindingListView.Items.Count - 1, item);
                });
                _unbinding_current_page++;
                UnBindingListView.ScrollIntoView(sender);
            }
            (sender as ListViewItem).Content = "点击加载更多...";
            _unbinding_busy = false;
        }