Esempio n. 1
0
        //private void Current_ShareDataChanged()
        //{
        //    Stories.ToList().ForEach((s) => s.Readed = s.Readed);
        //}

        /// <summary>
        /// 刷新数据
        /// </summary>
        public async void Update()
        {
            IsLoading = true;
            var list = await _api.GetDuan(1);

            DuanIncrementalLoadingCollection c = new DuanIncrementalLoadingCollection();

            list?.ForEach((t) =>
            {
                var msg   = t.Content;
                t.Content = Regex.Replace(msg, "<.+?>", "");

                if (IsItemAdded(t))
                {
                    c.Add(t);
                }
            });

            Duans = c;

            c.DataLoaded  += C_DataLoaded;
            c.DataLoading += C_DataLoading;

            IsLoading = false;
        }
Esempio n. 2
0
        public async void LoadCache()
        {
            IsLoading = true;

            var list = await FileHelper.Current.ReadObjectAsync <List <Duan> >("duan_list.json");

            DuanIncrementalLoadingCollection c = new DuanIncrementalLoadingCollection();

            list?.ForEach((t) =>
            {
                if (IsItemAdded(t))
                {
                    c.Add(t);
                }
            });
            Duans = c;

            IsLoading = false;
        }