Exemplo n.º 1
0
        private void FindNextCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TextSearch.Text))
            {
                return;
            }

            var skipIndex = -1;

            if (DbItemsSelectedCount > 0)
            {
                skipIndex = SelectedCollection.Items.IndexOf(DbSelectedItems.Last());
            }

            foreach (var item in SelectedCollection.Items.Skip(skipIndex + 1))
            {
                if (ItemMatchesSearch(TextSearch.Text, item, CheckSearchCase.IsChecked ?? false))
                {
                    SelectDocumentInView(item);
                    return;
                }
            }

            MainSnackbar.MessageQueue.Enqueue($"No results for '{TextSearch.Text}'.");
        }
Exemplo n.º 2
0
        private void FindNextCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TextSearch.Text))
            {
                return;
            }

            var skipIndex = -1;

            if (DbItemsSelectedCount > 0)
            {
                skipIndex = SelectedCollection.Items.IndexOf(DbSelectedItems.Last());
            }

            foreach (var item in SelectedCollection.Items.Skip(skipIndex + 1))
            {
                if (ItemMatchesSearch(TextSearch.Text, item, (bool)CheckSearchCase.IsChecked))
                {
                    SelectDocumentInView(item);
                    return;
                }
            }
        }