コード例 #1
0
        private async void PullToRefresh_Refreshing(object sender, EventArgs args)
        {
            pullToRefresh.IsRefreshing = true;
            await Task.Delay(2000);

            var blogsTitleCount = pulltoRefreshViewModel.BlogsTitle.Count() - 1;

            if ((pulltoRefreshViewModel.BlogsInfo.Count - 1) == blogsTitleCount)
            {
                pullToRefresh.IsRefreshing = false;
                return;
            }

            var blogsCategoryCount = pulltoRefreshViewModel.BlogsCategory.Count() - 1;
            var blogsAuthorCount   = pulltoRefreshViewModel.BlogsAuthers.Count() - 1;
            var blogsReadMoreCount = pulltoRefreshViewModel.BlogsReadMoreInfo.Count() - 1;

            for (int i = 0; i < 3; i++)
            {
                var blogsCount = pulltoRefreshViewModel.BlogsInfo.Count;
                var item       = new ListViewBlogsInfo()
                {
                    BlogTitle       = pulltoRefreshViewModel.BlogsTitle[blogsTitleCount - blogsCount],
                    BlogAuthor      = pulltoRefreshViewModel.BlogsAuthers[blogsAuthorCount - blogsCount],
                    BlogCategory    = pulltoRefreshViewModel.BlogsCategory[blogsCategoryCount - blogsCount],
                    ReadMoreContent = pulltoRefreshViewModel.BlogsReadMoreInfo[blogsReadMoreCount - blogsCount],
                };
                pulltoRefreshViewModel.BlogsInfo.Insert(0, item);
            }
            pullToRefresh.IsRefreshing = false;
        }
コード例 #2
0
        private async void PullToRefresh_Refreshing(object sender, EventArgs args)
        {
            Assembly assembly = typeof(PullToRefresh).GetTypeInfo().Assembly;

            pullToRefresh.IsRefreshing = true;
            await Task.Delay(2000);

            var blogsTitleCount = pulltoRefreshViewModel.BlogsTitle.Count() - 1;

            if ((pulltoRefreshViewModel.BlogsInfo.Count - 1) == blogsTitleCount)
            {
                pullToRefresh.IsRefreshing = false;
                return;
            }

            var blogsCategoryCount = pulltoRefreshViewModel.BlogsCategory.Count() - 1;
            var blogsAuthorCount   = pulltoRefreshViewModel.BlogsAuthers.Count() - 1;
            var blogsReadMoreCount = pulltoRefreshViewModel.BlogsReadMoreInfo.Count() - 1;

            for (int i = 0; i < 3; i++)
            {
                var blogsCount = pulltoRefreshViewModel.BlogsInfo.Count;
                var item       = new ListViewBlogsInfo()
                {
                    BlogTitle       = pulltoRefreshViewModel.BlogsTitle[blogsTitleCount - blogsCount],
                    BlogAuthor      = pulltoRefreshViewModel.BlogsAuthers[blogsAuthorCount - blogsCount],
                    BlogCategory    = pulltoRefreshViewModel.BlogsCategory[blogsCategoryCount - blogsCount],
                    ReadMoreContent = pulltoRefreshViewModel.BlogsReadMoreInfo[blogsReadMoreCount - blogsCount],
#if COMMONSB
                    BlogAuthorIcon     = ImageSource.FromResource("SampleBrowser.Icons.BlogAuthor.png", assembly),
                    BlogCategoryIcon   = ImageSource.FromResource("SampleBrowser.Icons.BlogCategory.png", assembly),
                    BlogFacebookIcon   = ImageSource.FromResource("SampleBrowser.Icons.Blog_Facebook.png", assembly),
                    BlogTwitterIcon    = ImageSource.FromResource("SampleBrowser.Icons.Blog_Twitter.png", assembly),
                    BlogGooglePlusIcon = ImageSource.FromResource("SampleBrowser.Icons.Blog_Google Plus.png", assembly),
                    BlogLinkedInIcon   = ImageSource.FromResource("SampleBrowser.Icons.Blog_LinkedIn.png", assembly),
#else
                    BlogAuthorIcon     = ImageSource.FromResource("SampleBrowser.SfListView.Icons.BlogAuthor.png", assembly),
                    BlogCategoryIcon   = ImageSource.FromResource("SampleBrowser.SfListView.Icons.BlogCategory.png", assembly),
                    BlogFacebookIcon   = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_Facebook.png", assembly),
                    BlogTwitterIcon    = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_Twitter.png", assembly),
                    BlogGooglePlusIcon = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_Google Plus.png", assembly),
                    BlogLinkedInIcon   = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_LinkedIn.png", assembly),
#endif
                };
                pulltoRefreshViewModel.BlogsInfo.Insert(0, item);
            }
            pullToRefresh.IsRefreshing = false;
        }
コード例 #3
0
        internal ObservableCollection <ListViewBlogsInfo> GenerateSource()
        {
            blogsInfo = new ObservableCollection <ListViewBlogsInfo>();
            var blogsTitleCount    = BlogsTitle.Count() - 1;
            var blogsCategoryCount = BlogsCategory.Count() - 1;
            var blogsAuthorCount   = BlogsAuthers.Count() - 1;
            var blogsReadMoreCount = BlogsReadMoreInfo.Count() - 1;

            for (int i = 0; i < 5; i++)
            {
                var blog = new ListViewBlogsInfo()
                {
                    BlogTitle       = BlogsTitle[blogsTitleCount - i],
                    BlogCategory    = BlogsCategory[blogsCategoryCount - i],
                    BlogAuthor      = BlogsAuthers[blogsAuthorCount - i],
                    ReadMoreContent = BlogsReadMoreInfo[blogsReadMoreCount - i],
                };
                blogsInfo.Insert(0, blog);
            }
            return(blogsInfo);
        }
コード例 #4
0
        internal ObservableCollection <ListViewBlogsInfo> GenerateSource()
        {
            blogsInfo = new ObservableCollection <ListViewBlogsInfo>();
            Assembly assembly           = typeof(PullToRefresh).GetTypeInfo().Assembly;
            var      blogsTitleCount    = BlogsTitle.Count() - 1;
            var      blogsCategoryCount = BlogsCategory.Count() - 1;
            var      blogsAuthorCount   = BlogsAuthers.Count() - 1;
            var      blogsReadMoreCount = BlogsReadMoreInfo.Count() - 1;

            for (int i = 0; i < 5; i++)
            {
                var blog = new ListViewBlogsInfo()
                {
                    BlogTitle    = BlogsTitle[blogsTitleCount - i],
                    BlogCategory = BlogsCategory[blogsCategoryCount - i],
                    BlogAuthor   = BlogsAuthers[blogsAuthorCount - i],
#if COMMONSB
                    BlogAuthorIcon     = ImageSource.FromResource("SampleBrowser.Icons.BlogAuthor.png", assembly),
                    BlogCategoryIcon   = ImageSource.FromResource("SampleBrowser.Icons.BlogCategory.png", assembly),
                    BlogFacebookIcon   = ImageSource.FromResource("SampleBrowser.Icons.Blog_Facebook.png", assembly),
                    BlogTwitterIcon    = ImageSource.FromResource("SampleBrowser.Icons.Blog_Twitter.png", assembly),
                    BlogGooglePlusIcon = ImageSource.FromResource("SampleBrowser.Icons.Blog_Google Plus.png", assembly),
                    BlogLinkedInIcon   = ImageSource.FromResource("SampleBrowser.Icons.Blog_LinkedIn.png", assembly),
#else
                    BlogAuthorIcon     = ImageSource.FromResource("SampleBrowser.SfListView.Icons.BlogAuthor.png", assembly),
                    BlogCategoryIcon   = ImageSource.FromResource("SampleBrowser.SfListView.Icons.BlogCategory.png", assembly),
                    BlogFacebookIcon   = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_Facebook.png", assembly),
                    BlogTwitterIcon    = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_Twitter.png", assembly),
                    BlogGooglePlusIcon = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_Google Plus.png", assembly),
                    BlogLinkedInIcon   = ImageSource.FromResource("SampleBrowser.SfListView.Icons.Blog_LinkedIn.png", assembly),
#endif
                    ReadMoreContent = BlogsReadMoreInfo[blogsReadMoreCount - i],
                };
                blogsInfo.Insert(0, blog);
            }
            return(blogsInfo);
        }