コード例 #1
0
        async void LoadLastData(CancellationTokenSource cts)
        {
            // 直接载入并定位到最后一个回复
            int[] data = await _ds.LoadReplyDataForRedirectToLastPostAsync(_threadId, cts);

            if (data != null)
            {
                int pageNo = data[0];
                int index  = data[1];
                _threadId = data[2];
                _ds.SetScrollState(false);
                var cv = _ds.GetViewForRedirectToPostByThreadId(pageNo, _threadId, index, _beforeLoad, _afterLoad, _listViewScroll);
                if (cv != null)
                {
                    ReplyItemCollection = cv;
                    _startPageNo        = pageNo;
                }
            }
        }
コード例 #2
0
        async void FirstLoad(CancellationTokenSource cts)
        {
            // 先载入第一个转跳到的页面的数据,并得到页码之后即可进入正常流程
            int[] data = await _ds.LoadReplyDataForRedirectToSpecifiedPostAsync(_postId, cts);

            if (data != null)
            {
                int pageNo = data[0];
                int index  = data[1];
                _threadId = data[2];
                _ds.SetScrollState(false);

                var cv = _ds.GetViewForRedirectToPostByThreadId(pageNo, _threadId, index, _beforeLoad, _afterLoad, _listViewScroll);
                if (cv != null)
                {
                    ReplyItemCollection = cv;
                    _startPageNo        = pageNo;
                }
            }
        }