public GetItem ( int index ) : |
||
index | int | |
return |
void sgBox_UserConfirmSelectedItem(object sender, EventArgs e) { if (_textbox.CurrentTextSpan != null) { _textbox.ReplaceCurrentTextRunContent(_currentLocalText.Length, (string)_sgBox.GetItem(_sgBox.SelectedIndex).Tag); //------------------------------------- //then hide suggestion list _sgBox.ClearItems(); _sgBox.Hide(); //-------------------------------------- } }
void textSurfaceListener_PreviewEnterKeyDown(object sender, Text.TextDomEventArgs e) { //accept selected text if (!sgBox.Visible || sgBox.SelectedIndex < 0) { return; } if (textbox.CurrentTextSpan != null) { textbox.ReplaceCurrentTextRunContent(currentLocalText.Length, (string)sgBox.GetItem(sgBox.SelectedIndex).Tag); //------------------------------------- //then hide suggestion list sgBox.ClearItems(); sgBox.Hide(); //-------------------------------------- } e.PreventDefault = true; }