private async Task GetForumThreads()
        {
            if (_forumEntity.IsBookmarks)
            {
                AddThreadButton.Visibility  = Visibility.Collapsed;
                BookmarkSettings.Visibility = Visibility.Visible;
                _forumThreadEntities        = await _threadManager.GetBookmarks(_forumEntity);

                DefaultViewModel["Threads"]          = _forumThreadEntities;
                SubForumList.Visibility              = Visibility.Collapsed;
                SubForumListSnapped.Visibility       = Visibility.Collapsed;
                NotificationButton.Visibility        = Visibility.Visible;
                RemoveNotificationsButton.Visibility = Visibility.Visible;
            }
            else
            {
                _forumPageScrollingCollection = new PageScrollingCollection(_forumEntity, 1);
                _forumThreadEntities          = await _threadManager.GetForumThreads(_forumEntity, 1);

                foreach (var forumThread in _forumThreadEntities)
                {
                    _forumPageScrollingCollection.Add(forumThread);
                }
                _subForumEntities = await _forumManager.GetSubForums(_forumEntity);

                DefaultViewModel["Threads"]   = _forumPageScrollingCollection;
                DefaultViewModel["Subforums"] = _subForumEntities;
            }
        }
Exemple #2
0
 public async void Initialize(ForumEntity forumEntity)
 {
     this.ForumEntity = forumEntity;
     IsBookmarks      = forumEntity.IsBookmarks;
     ForumTitle       = forumEntity.Name;
     SubForumEntities = new ObservableCollection <ForumEntity>();
     try
     {
         if (forumEntity.IsBookmarks)
         {
             _localSettings = ApplicationData.Current.LocalSettings;
             ForumPageScrollingCollection = new PageScrollingCollection(forumEntity, 1);
         }
         else
         {
             ForumPageScrollingCollection = new PageScrollingCollection(forumEntity, 1);
             SubForumEntities             = await _forumManager.GetSubForums(forumEntity);
         }
     }
     catch (Exception ex)
     {
         AwfulDebugger.SendMessageDialogAsync("Failed to initialize threads", ex);
     }
 }