private async Task UpdateThread(ThreadInfoViewModel threadInfo) { threadInfo.IsLoading = true; try { Thread newThread = await Board.LoadThreadAsync(threadInfo.ThreadInfo.GetLink(), threadInfo.ThreadInfo.LastLoadedPostPosition + 1); threadInfo.UnreadPosts += newThread.Posts.Count; threadInfo.ThreadInfo.LastLoadedPostPosition += newThread.Posts.Count; } catch { // It's fine } threadInfo.IsLoading = false; }
public async void Favorite(ThreadInfoViewModel thread) { FavoriteThreads.Items.Add(thread.ThreadInfo); await FavoriteThreads.Save(); }
public void NavigateToThread(ThreadInfoViewModel threadInfoViewModel) { ThreadInfo threadInfo = threadInfoViewModel.ThreadInfo; ThreadNavigation navigation = ThreadNavigation .NavigateToThread(threadInfo.BoardId, threadInfo.Number) .ScrollToPostByPosition(threadInfo.LastReadPostPosition + 1) .WithHighlighting(threadInfo.LastReadPostPosition + 1); Shell.Navigate<ThreadViewModel>(navigation); }
public async Task Remove(ThreadInfoViewModel threadInfoViewModel) { if (IsLoading) return; IsLoading = true; RepositoryService.Items.Remove(threadInfoViewModel.ThreadInfo); Threads.Remove(threadInfoViewModel); await RepositoryService.Save(); IsLoading = false; }