private void ExecuteScrollTo(object p) { if (WordList != null) { int index = WordList.BinarySearch(new WordItem(ScrollToText)); if (index >= 0) { if (WordList[index] == ScrollToItem) { ScrollToItem = null; // force a property changed notification } // expand the group that the search word belongs too int firstItem = WordList.BinarySearch(new WordItem(new string ('a', ScrollToText.Length))); if (firstItem < 0) { WordList[~firstItem].IsExpanded = true; } // select and scroll into view ScrollToItem = WordList[index]; } } }
private bool WordListContains() { if ((WordList != null) && (ScrollToText != null) && (ScrollToText.Length >= WordDictionary.cMinLetters)) { return(WordList.BinarySearch(new WordItem(ScrollToText)) >= 0); } return(false); }