Beispiel #1
0
        public void KeyPressed(KeyCode keyCode, KeyModifiers keyModifiers)
        {
            if (keyCode == KeyCode.Return)
            {
                InputReceived?.Invoke(this, InputText);
                InputText     = string.Empty;
                IsTakingInput = false;
            }
            else if (keyCode == KeyCode.Backspace)
            {
                if (InputText.Length == 0)
                {
                    return;
                }

                InputText = InputText.Substring(0, InputText.Length - 1);
            }
            else if (keyCode == KeyCode.Escape)
            {
                InputText     = string.Empty;
                IsTakingInput = false;

                InputCanceled?.Invoke(this, EventArgs.Empty);
            }
        }
 protected void OnRightMouseButtonUpHandler()
 {
     if (StartedDrag)
     {
         StartedDrag = false;
         InputCanceled?.Invoke();
     }
 }
Beispiel #3
0
 private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     InputCanceled?.Invoke(this, new EventArgs());
     Close();
 }