public SrsEntryLevelFilterViewModel()
 {
     SrsLevelPickerVm = new SrsLevelPickerViewModel();
     SrsLevelPickerVm.SrsLevelSelected += OnSrsLevelSelected;
     SrsLevelPickerVm.Initialize(0);
     ComparisonOperator = DefaultComparisonOperator;
 }
Пример #2
0
        public SrsEntryListViewModel(SrsEntryFilter filter)
            : base(filter)
        {
            IsFilterEmpty = filter.IsEmpty();
            SelectedItems = new List <FilteringSrsEntry>();
            _srsEntryDao  = new SrsEntryDao();

            LevelPickerVm = new SrsLevelPickerViewModel();
            LevelPickerVm.Initialize(0);

            TimingVm    = new SrsTimingViewModel();
            TimingDelay = 24;

            RefreshSelectionCommand    = new RelayCommand(OnRefreshSelection);
            SelectSrsItemCommand       = new RelayCommand <FilteringSrsEntry>(OnSelectSrsItem);
            EditSingleItemCommand      = new RelayCommand <FilteringSrsEntry>(OnEditSingleItem);
            UnselectCommand            = new RelayCommand(OnUnselect);
            SelectAllCommand           = new RelayCommand(OnSelectAll);
            EditSingleSelectionCommand = new RelayCommand(OnEditSingleSelection);
            BulkEditMeaningNoteCommand = new RelayCommand(OnBulkEditMeaningNote);
            BulkEditReadingNoteCommand = new RelayCommand(OnBulkEditReadingNote);
            BulkEditTagsCommand        = new RelayCommand(OnBulkEditTags);
            BulkEditTextApplyCommand   = new RelayCommand(OnBulkEditTextApply);
            BulkEditLevelCommand       = new RelayCommand(OnBulkEditLevel);
            BulkEditLevelApplyCommand  = new RelayCommand(OnBulkEditLevelApply);
            CancelBulkEditCommand      = new RelayCommand(OnCancelBulkEdit);
            BulkSuspendCommand         = new RelayCommand(OnBulkSuspend);
            BulkResumeCommand          = new RelayCommand(OnBulkResume);
            BulkDeleteCommand          = new RelayCommand(OnBulkDelete);
            ExportCommand              = new RelayCommand(OnExport);
            BulkRescheduleCommand      = new RelayCommand(OnBulkReschedule);
            BulkRescheduleApplyCommand = new RelayCommand(OnBulkRescheduleApply);
            BulkDelayCommand           = new RelayCommand(OnBulkDelay);
            BulkDelayApplyCommand      = new RelayCommand(OnBulkDelayApply);
        }
 public SrsEntryLevelFilterViewModel()
 {
     SrsLevelPickerVm = new SrsLevelPickerViewModel();
     SrsLevelPickerVm.SrsLevelSelected += OnSrsLevelSelected;
     SrsLevelPickerVm.Initialize(0);
     ComparisonOperator = DefaultComparisonOperator;
 }
Пример #4
0
        /// <summary>
        /// Builds a ViewModel aimed at editing an existing SrsEntry,
        /// or adding a pre-composed SrsEntry.
        /// </summary>
        /// <param name="entity">Entity to edit.</param>
        public SrsEntryViewModel(SrsEntry entity)
        {
            // Initialize fields.
            _entry = new ExtendedSrsEntry(entity);
            _originalNextReviewDate = entity.NextAnswerDate;
            _originalLevelValue     = entity.CurrentGrade;
            _associatedKanjiString  = Entry.AssociatedKanji;
            _associatedVocabString  = Entry.AssociatedVocab;
            _srsEntryDao            = new SrsEntryDao();
            _kanjiDao = new KanjiDao();
            _vocabDao = new VocabDao();
            if (IsNew)
            {
                Entry.Tags = Properties.Settings.Default.LastSrsTagsValue;
            }

            // Create the relay commands.
            SubmitCommand               = new RelayCommand(OnSubmit);
            CancelCommand               = new RelayCommand(OnCancel);
            SrsProgressResetCommand     = new RelayCommand(OnSrsProgressReset);
            ApplyAssociatedKanjiCommand = new RelayCommand(OnApplyAssociatedKanji);
            ApplyAssociatedVocabCommand = new RelayCommand(OnApplyAssociatedVocab);
            ToggleSuspendCommand        = new RelayCommand(OnToggleSuspend);
            DeleteCommand               = new RelayCommand(OnDelete);
            ToggleDateEditCommand       = new RelayCommand(OnToggleDateEdit);
            DateToNowCommand            = new RelayCommand(OnDateToNow);
            DateToNeverCommand          = new RelayCommand(OnDateToNever);

            // Get the associated kanji or vocab.
            GetAssociatedKanji();
            GetAssociatedVocab();

            // Initialize the VM.
            _isFirstSrsLevelSelect             = true;
            SrsLevelPickerVm                   = new SrsLevelPickerViewModel();
            SrsLevelPickerVm.SrsLevelSelected += OnSrsLevelSelected;
            SrsLevelPickerVm.Initialize(_entry.CurrentGrade);
        }
Пример #5
0
        /// <summary>
        /// Builds a ViewModel aimed at editing an existing SrsEntry,
        /// or adding a pre-composed SrsEntry.
        /// </summary>
        /// <param name="entity">Entity to edit.</param>
        public SrsEntryViewModel(SrsEntry entity)
        {
            // Initialize fields.
            _entry = new ExtendedSrsEntry(entity);
            _originalNextReviewDate = entity.NextAnswerDate;
            _originalLevelValue = entity.CurrentGrade;
            _associatedKanjiString = Entry.AssociatedKanji;
            _associatedVocabString = Entry.AssociatedVocab;
            _srsEntryDao = new SrsEntryDao();
            _kanjiDao = new KanjiDao();
            _vocabDao = new VocabDao();
            if (IsNew)
            {
                Entry.Tags = Properties.Settings.Default.LastSrsTagsValue;
            }

            // Create the relay commands.
            SubmitCommand = new RelayCommand(OnSubmit);
            CancelCommand = new RelayCommand(OnCancel);
            SrsProgressResetCommand = new RelayCommand(OnSrsProgressReset);
            ApplyAssociatedKanjiCommand = new RelayCommand(OnApplyAssociatedKanji);
            ApplyAssociatedVocabCommand = new RelayCommand(OnApplyAssociatedVocab);
            ToggleSuspendCommand = new RelayCommand(OnToggleSuspend);
            DeleteCommand = new RelayCommand(OnDelete);
            ToggleDateEditCommand = new RelayCommand(OnToggleDateEdit);
            DateToNowCommand = new RelayCommand(OnDateToNow);
            DateToNeverCommand = new RelayCommand(OnDateToNever);

            // Get the associated kanji or vocab.
            GetAssociatedKanji();
            GetAssociatedVocab();

            // Initialize the VM.
            _isFirstSrsLevelSelect = true;
            SrsLevelPickerVm = new SrsLevelPickerViewModel();
            SrsLevelPickerVm.SrsLevelSelected += OnSrsLevelSelected;
            SrsLevelPickerVm.Initialize(_entry.CurrentGrade);
        }