Esempio n. 1
0
        /// <summary>
        /// 数据初始化
        /// </summary>
        async void Init()
        {
            FavoritesFeed = await FeedDataHandler.GetFavoritesAsync() ?? FavoritesFeed;

            if (string.IsNullOrWhiteSpace(FavoritesFeed.Name))
            {
                FavoritesFeed.Name = "收藏";
            }
            if (FavoritesFeed.Articles == null)
            {
                FavoritesFeed.Articles = new ObservableCollection <ArticleViewModel>();
            }

            NewFeeds.CollectionChanged += NewFeeds_CollectionChanged;
            NewFeeds.Clear();
            FeedDataHandler.GetFeedsAsync().ForEach(feed => NewFeeds.Add(feed));

            FavoritesFeed.Articles.CollectionChanged += Articles_CollectionChanged;
        }
Esempio n. 2
0
        public async void TestMethod4()
        {
            FeedViewModel feed = await FeedDataHandler.GetFavoritesAsync();

            Console.WriteLine(feed.Link.ToString());
        }