Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
 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);
         }
     }
 }
Beispiel #3
0
 void layoutRoot_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     _valueText.Focus();
 }