Ejemplo n.º 1
0
        /// <summary>
        /// Builds a kanji details ViewModel handling the given kanji.
        /// </summary>
        /// <param name="kanjiEntity">Kanji to handle.</param>
        public KanjiDetailsViewModel(ExtendedKanji kanjiEntity)
        {
            KanjiEntity = kanjiEntity;

            if (KanjiEntity.DbKanji.SrsEntries.Any())
            {
                SrsEntry = new ExtendedSrsEntry(
                    KanjiEntity.DbKanji.SrsEntries.First());
            }

            VocabFilter filter = new VocabFilter()
            {
                Kanji = new KanjiEntity[] { _kanjiEntity.DbKanji }
            };

            VocabListVm = new VocabListViewModel(filter);
            VocabListVm.KanjiNavigated += OnKanjiNavigated;
            VocabFilterVm = new VocabFilterViewModel(filter);
            VocabFilterVm.FilterChanged += OnVocabFilterChanged;

            ToggleDetailsCommand = new RelayCommand(OnToggleDetails);
            AddToSrsCommand      = new RelayCommand(OnAddToSrs);
            EditSrsEntryCommand  = new RelayCommand(OnEditSrsEntry);
            FilterReadingCommand = new RelayCommand <string>(OnFilterReading);

            NextStrokeCommand     = new RelayCommand(OnNextStroke);
            PreviousStrokeCommand = new RelayCommand(OnPreviousStroke);
            LastStrokeCommand     = new RelayCommand(OnLastStroke);
            FirstStrokeCommand    = new RelayCommand(OnFirstStroke);
            WaniKaniCommand       = new RelayCommand(OnWaniKani);

            PrepareSvg();
        }
Ejemplo n.º 2
0
 public VocabViewModel()
     : base(NavigationPageEnum.Vocab)
 {
     _filter       = new VocabFilter();
     VocabListVm   = new VocabListViewModel(_filter);
     VocabFilterVm = new VocabFilterViewModel(_filter);
     VocabListVm.KanjiNavigated  += OnKanjiNavigation;
     VocabFilterVm.FilterChanged += OnFilterChanged;
 }
Ejemplo n.º 3
0
 public VocabViewModel()
     : base(NavigationPageEnum.Vocab)
 {
     _filter = new VocabFilter();
     VocabListVm = new VocabListViewModel(_filter);
     VocabFilterVm = new VocabFilterViewModel(_filter);
     VocabListVm.KanjiNavigated += OnKanjiNavigation;
     VocabFilterVm.FilterChanged += OnFilterChanged;
 }
        /// <summary>
        /// Builds a kanji details ViewModel handling the given kanji.
        /// </summary>
        /// <param name="kanjiEntity">Kanji to handle.</param>
        public KanjiDetailsViewModel(ExtendedKanji kanjiEntity)
        {
            KanjiEntity = kanjiEntity;

            if (KanjiEntity.DbKanji.SrsEntries.Any())
            {
                SrsEntry = new ExtendedSrsEntry(
                    KanjiEntity.DbKanji.SrsEntries.First());
            }

            VocabFilter filter = new VocabFilter() {
                Kanji = new KanjiEntity[] { _kanjiEntity.DbKanji } };

            VocabListVm = new VocabListViewModel(filter);
            VocabListVm.KanjiNavigated += OnKanjiNavigated;
            VocabFilterVm = new VocabFilterViewModel(filter);
            VocabFilterVm.FilterChanged += OnVocabFilterChanged;

            ToggleDetailsCommand = new RelayCommand(OnToggleDetails);
            AddToSrsCommand = new RelayCommand(OnAddToSrs);
            EditSrsEntryCommand = new RelayCommand(OnEditSrsEntry);
            FilterReadingCommand = new RelayCommand<string>(OnFilterReading);

            NextStrokeCommand = new RelayCommand(OnNextStroke);
            PreviousStrokeCommand = new RelayCommand(OnPreviousStroke);
            LastStrokeCommand = new RelayCommand(OnLastStroke);
            FirstStrokeCommand = new RelayCommand(OnFirstStroke);
            WaniKaniCommand = new RelayCommand(OnWaniKani);

            PrepareSvg();
        }