Inheritance: ThreadsRepositoryServiceBase
        public RecentThreadsViewModel(
            RecentThreadsService repositoryService,
            IBoard board,
            IShell shell,
            FavoriteThreadsService favoriteThreads)
            : base(repositoryService, board, shell) {

            FavoriteThreads = favoriteThreads;
            var dialog = new MessageDialog(
                Localization.GetForView("RecentThreads", "ClearConfirmationContent"),
                Localization.GetForView("RecentThreads", "ClearConfirmationTitle"));

            dialog.AddButton(
                Localization.GetForView("RecentThreads", "ConfirmClear"),
                async () => {
                    IsLoading = true;
                    Threads.Clear();
                    RepositoryService.Items.Clear();
                    await RepositoryService.Save();
                    IsLoading = false;
                });

            dialog.AddButton(
                Localization.GetForView("RecentThreads", "DontClear"), () => { });

            ClearConfirmationDialog = dialog;
        }
Beispiel #2
0
 public FavoritesViewModel(FavoriteThreadsService threadsRepositoryService,
                           FavoritePostsService favoritePostsService,
                           IBoard board,
                           IShell shell)
     : base(threadsRepositoryService, board, shell) {
     FavoritePosts = favoritePostsService;
     Posts = new ObservableCollection<PostViewModel>();
 }