Ejemplo n.º 1
0
        void textSurfaceListener_PreviewEnterKeyDown(object sender, TextEditing.TextDomEventArgs e)
        {
            //accept selected text

            if (_textbox.CurrentTextSpan != null)
            {
                if (_listbox.SelectedIndex >= 0)
                {
                    _textbox.ReplaceCurrentTextRunContent(_currentLocalText.Length,
                                                          (string)_listbox.GetItem(_listbox.SelectedIndex).Tag);
                    //-------------------------------------
                    //then hide suggestion list
                    _listbox.ClearItems();
                    _listbox.Visible = false;
                    //--------------------------------------
                }
            }
            e.PreventDefault = true;
        }
Ejemplo n.º 2
0
 public void ClearItems() => _listbox.ClearItems();