/// <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> /// Event callback. /// Called when the vocab filter changes. /// Refreshes the vocab list. /// </summary> private void OnVocabFilterChanged(object sender, EventArgs e) { VocabListVm.ReapplyFilter(); }