Example #1
0
        public void AddRecent(Collection collection)
        {
            var recentModSet = new RecentCollection(collection);

            RecentCollections.AddLocked(recentModSet);
            recentModSet.Collection = collection;
            collection.RefreshLastJoinedOn();
            SaveSettings();
        }
Example #2
0
        private async void RemoveCollection(RecentCollectionViewModel recent_collection)
        {
            logger.Trace($"Removing collection [{recent_collection.Name} - {recent_collection.Filename}]");

            if (!recent_collection.Invalid)
            {
                var result = (bool)await DialogManager.ShowPromptDialogAsync("Removing Collection", "Do you want to delete it from disk?");

                if (result)
                {
                    repository.DeleteCollection(recent_collection.Filename);
                }
            }

            state_manager.RemoveFromRecentCollections(recent_collection.Obj);
            RecentCollections.Remove(recent_collection);
        }
Example #3
0
        private async void SelectCollection(RecentCollectionViewModel recent_collection)
        {
            logger.Trace($"Selected collection [{recent_collection.Name} - {recent_collection.Filename}]");

            if (recent_collection.Invalid)
            {
                var result = (bool)await DialogManager.ShowPromptDialogAsync("Invalid Collection", "Do you want to remove it from the list?");

                if (result)
                {
                    state_manager.RemoveFromRecentCollections(recent_collection.Obj);
                    RecentCollections.Remove(recent_collection);
                }
            }
            else
            {
                var collection = repository.LoadCollection(recent_collection.Filename);
                state_manager.SetCurrentCollection(collection);
                MessageBus.Current.SendMessage(NavigationMessage.Books);
            }
        }
Example #4
0
 public override void OnDeactivated()
 {
     RecentCollections.DisposeAll();
     RecentCollections = null;
 }