/// <summary> /// Disposes the resources used by this object. /// </summary> public override void Dispose() { VocabListVm.KanjiNavigated -= OnKanjiNavigation; VocabListVm.Dispose(); VocabFilterVm.FilterChanged -= OnFilterChanged; VocabFilterVm.Dispose(); base.Dispose(); }
/// <summary> /// Called when the FilterReadingCommand is fired. /// Filters the vocab of the kanji by the specified reading. /// </summary> /// <param name="reading">Reading to use as a filter.</param> private void OnFilterReading(string reading) { // This command is not fired by typing, but rather from events like // clicking on a reading on the kanji page. // In those events, we *do* want to automatically re-apply the filter. string newReading = reading.Replace("ー", string.Empty).Replace(".", string.Empty); if (VocabFilterVm.ReadingFilter == newReading) { return; } VocabFilterVm.ReadingFilter = newReading; VocabListVm.ReapplyFilter(); }
/// <summary> /// Disposes resources used by this object. /// </summary> public override void Dispose() { VocabListVm.KanjiNavigated -= OnKanjiNavigated; KanjiNavigated = null; VocabListVm.Dispose(); VocabFilterVm.FilterChanged -= OnVocabFilterChanged; VocabFilterVm.Dispose(); if (_strokeUpdateTimer != null) { _strokeUpdateTimer.Tick -= OnStrokeUpdateTimerTick; } base.Dispose(); }
/// <summary> /// Event callback. /// Called when the vocab filter changes. /// Refreshes the vocab list. /// </summary> private void OnVocabFilterChanged(object sender, EventArgs e) { VocabListVm.ReapplyFilter(); }