private async void DoSelectionMatch(object state)
        {
            SelectionChangedTimer.Change(Timeout.Infinite, Timeout.Infinite);

            await Application.Current.Dispatcher.Invoke(async() =>
            {
                var lastSelectionTextbox = lastRoutedArgs.OriginalSource as System.Windows.Controls.TextBox;

                SelectedTextParts.Clear();
                RaisePropertyChanged("SelectedTextParts");
                await Task.Delay(200).ConfigureAwait(false);

                for (var a = 0; a < TextParts.Count; a++)
                {
                    TextParts[a].IsSelected = false;
                }

                await Task.Delay(100).ConfigureAwait(false);

                var selectedText = lastSelectionTextbox.SelectedText.Trim();

                if (selectedText?.Length == 0)
                {
                    return;
                }

                var selectionStart = lastSelectionTextbox.SelectionStart;

                var beforeSelection = lastSelectionTextbox.Text.Substring(0, selectionStart);

                var cumulativeText = "";
                var foundText      = "";

                foreach (var txt in TextParts)
                {
                    cumulativeText += txt.Text + " ";
                    if (cumulativeText.Trim().Length > selectionStart)
                    {
                        txt.IsSelected = true;
                        SelectedTextParts.Add(txt);
                        foundText += txt.Text + " ";
                    }

                    if (foundText.Trim().Length >= selectedText.Length)
                    {
                        break;
                    }
                }
            });
        }
 private void DoSelectionMatchCommand(object state)   // Not working
 {
     lastRoutedArgs = state as RoutedEventArgs;
     SelectionChangedTimer.Change(500, Timeout.Infinite);
 }