<commit_before>﻿using Caliburn.Micro;
using MyHoard.Models;
using MyHoard.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyHoard.ViewModels
{
    public class CollectionListViewModel : ViewModelBase
    {
        
        private List<Collection> collections;
        private Collection selectedCollection;
                
        public CollectionListViewModel(INavigationService navigationService, CollectionService collectionService)
            : base(navigationService, collectionService)
        {
            Collections = collectionService.CollectionList().OrderBy(e => e.Name).ToList<Collection>();
        }

        public void AddCollection()
        {
            NavigationService.UriFor<AddCollectionViewModel>().Navigate();
        }

        public List<Collection> Collections
        {
            get { return collections; }
            set
            {
                collections = value;
                NotifyOfPropertyChange(() => Collections);
            }
        }

        public Collection SelectedCollection
        {
            get { return selectedCollection; }
            set 
            { 
                selectedCollection = value;
                NotifyOfPropertyChange(() => SelectedCollection);
            }
        }

        public void CollectionDetails()
        {
            NavigationService.UriFor<CollectionDetailsViewModel>().WithParam(x => x.CollectionId, SelectedCollection.Id).Navigate();
        }<commit_msg>fixed bug (not refreshing list in CollectionListView after editing a collection)<commit_after>﻿using Caliburn.Micro;
using MyHoard.Models;
using MyHoard.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyHoard.ViewModels
{
    public class CollectionListViewModel : ViewModelBase
    {
        
        private List<Collection> collections;
        private Collection selectedCollection;
                
        public CollectionListViewModel(INavigationService navigationService, CollectionService collectionService)
            : base(navigationService, collectionService)
        {
            
        }

        public void AddCollection()
        {
            NavigationService.UriFor<AddCollectionViewModel>().Navigate();
        }

        public List<Collection> Collections
        {
            get { return collections; }
            set
            {
                collections = value;
                NotifyOfPropertyChange(() => Collections);
            }
        }

        public Collection SelectedCollection
        {
            get { return selectedCollection; }
            set 
            { 
                selectedCollection = value;
                NotifyOfPropertyChange(() => SelectedCollection);
            }
        }

        public void CollectionDetails()
        {
            NavigationService.UriFor<CollectionDetailsViewModel>().WithParam(x => x.CollectionId, SelectedCollection.Id).Navigate();
        }

        protected override void OnActivate()
        {
            base.OnActivate();
            Collections = CollectionService.CollectionList().OrderBy(e => e.Name).ToList<Collection>();
        }
{'fraction_non_alphanumeric': 0.07703973309068851, 'fraction_numerical': 0.0, 'mean_word_length': 2.062209842154132, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3516897', 'n_tokens_mistral': 760, 'n_tokens_neox': 716, 'n_words': 155}