Exemplo n.º 1
0
 /// <summary>
 /// Navigates to the kanji page, and performs an intra-navigation
 /// to the kanji referred by the given character.
 /// </summary>
 /// <param name="character">Character driving the navigation.</param>
 public void NavigateToKanji(KanjiWritingCharacter character)
 {
     lock (_mainWindowLock)
     {
         RequireMainWindow();
         CurrentPage = NavigationPageEnum.Kanji;
         KanjiVm.Navigate(character);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Navigates to the kanji referred by the given character.
        /// Filters using the referred vocab kanji writing string.
        /// Writes a navigation history entry to trace back to the
        /// navigation state active before the operation.
        /// </summary>
        /// <param name="character">
        /// Character driving the navigation.</param>
        public void Navigate(KanjiWritingCharacter character)
        {
            if (KanjiDetailsVm != null)
            {
                // Temporarily unsubscribe the event.
                KanjiDetailsVm.KanjiNavigated -= OnKanjiNavigated;
            }

            // Add the current state to the navigation history.
            PushNavigationHistoryEntry();

            // Create a new filter matching the vocab word selected.
            _kanjiFilter = new KanjiFilter()
            {
                TextFilter = character.OriginalVocab.KanjiWriting
            };

            // Apply the filter
            KanjiFilterVm.SetFilter(_kanjiFilter);
            KanjiListVm.Navigate(_kanjiFilter, character.Kanji);

            // Create a new KanjiDetailsVm.
            // Do not use the SetKanjiDetailsVm method as to not dispose
            // the previous value.
            KanjiDetailsVm = new KanjiDetailsViewModel(new ExtendedKanji(character.Kanji));

            // Re-subscribe the event.
            KanjiDetailsVm.KanjiNavigated += OnKanjiNavigated;
        }
 public KanjiNavigatedEventArgs(KanjiWritingCharacter character)
 {
     Character = character;
 }
 public KanjiNavigatedEventArgs(KanjiWritingCharacter character)
 {
     Character = character;
 }