private void AssociatedObject_TextInput(object sender, TextCompositionEventArgs e) { if (string.IsNullOrEmpty(TriggerChar)) { return; } var text = e.Text; if (text.StartsWith(TriggerChar, StringComparison.Ordinal)) { AutoCompletePopup.IsOpen = true; AutoCompleteBox.Focus(); HintAssist.SetHint(AutoCompleteBox, TriggerChar); AutoCompleteBox.Text = string.Empty; e.Handled = true; } }
private void InputBox_KeyDown(object sender, KeyEventArgs e) { lastSelectionStart = InputBox.SelectionStart; if (e.Key == Key.Enter) { if (AutoCompleteBox.Items.Count != 0) { if (AutoCompleteBox.Focus()) { AutoCompleteBox.SelectedIndex = 0; } } else { CalcButton_Click(sender, e); } } }
void layoutRoot_Tap(object sender, System.Windows.Input.GestureEventArgs e) { _valueText.Focus(); }