Esempio n. 1
0
        private void SearchTextChangedHandler(object sender, TextChangedEventArgs args)
        {
            var searchedWords = TextSearchHelper.GetSearchedWords(SearchPhraseTextBox.Text);

            _collectionView.Filter = searchedWords.Length == 0
                                ? (Predicate <object>)null
                                : e =>
            {
                var entry        = (StatementExecutionHistoryEntry)e;
                var textToSearch = $"{entry.StatementText.ToUpperInvariant()} {CellValueConverter.FormatDateTime(entry.ExecutedAt).ToUpperInvariant()} {entry.Tags?.ToUpperInvariant()}";
                return(searchedWords.All(textToSearch.Contains));
            };

            ListHistoryEntries.UpdateLayout();

            HighlightText(searchedWords);
        }
Esempio n. 2
0
 private void HistoryViewScrollChangedHandler(object sender, ScrollChangedEventArgs args)
 {
     HighlightText(TextSearchHelper.GetSearchedWords(SearchPhraseTextBox.Text));
 }