void UpdateSuggestionList() { //find suggestion words this.currentLocalText = null; _listView.ClearItems(); TextEditing.EditableRun currentSpan = _textbox.CurrentTextSpan; if (currentSpan == null) { _listView.Visible = false; return; } //------------------------------------------------------------------------- //sample parse ... //In this example all country name start with Captial letter so ... //try to get underlining text //int startAt, len; //textbox.FindCurrentUnderlyingWord(out startAt, out len); string currentTextSpanText = currentSpan.GetText().ToUpper(); //analyze content char[] textBuffer = currentTextSpanText.ToCharArray(); _textSplitBoundsList.Clear(); _textSplitBoundsList.AddRange(_textbox.TextSplitter.ParseWordContent(textBuffer, 0, textBuffer.Length)); //get last part of splited text int m = _textSplitBoundsList.Count; if (m < 1) { return; } int splitBoundIndex = GetProperSplitBoundIndex(_textSplitBoundsList, _textbox.CurrentLineCharIndex); if (splitBoundIndex < 0) { return; } //find current split bounds Composers.TextSplitBound selectBounds = _textSplitBoundsList[splitBoundIndex]; this.currentLocalText = GetString(textBuffer, selectBounds); char firstChar = currentLocalText[0]; List <string> keywords; if (_words.TryGetValue(firstChar, out keywords)) { int j = keywords.Count; int listViewWidth = _listView.Width; for (int i = 0; i < j; ++i) { string choice = keywords[i].ToUpper(); if (StringStartsWithChars(choice, currentLocalText)) { CustomWidgets.ListItem item = new CustomWidgets.ListItem(listViewWidth, 17); item.BackColor = Color.LightGray; item.Tag = item.Text = keywords[i]; _listView.AddItem(item); } } } if (_listView.ItemCount > 0) { _listView.Visible = true; //TODO: implement selectedIndex suggestion hint here *** _listView.SelectedIndex = 0; //move listview under caret position var caretPos = _textbox.CaretPosition; //temp fixed //TODO: review here _listView.SetLocation(_textbox.Left + caretPos.X, _textbox.Top + caretPos.Y + 20); _listView.EnsureSelectedItemVisible(); } else { _listView.Visible = false; } //------------------------------------------------------------------------- }