Exemplo n.º 1
0
 private void OnOKButtonClicked(object Sender, RoutedEventArgs EventArgs)
 {
     if (OnOKEvent != null)
     {
         OnOKEvent.Invoke();
     }
 }
        private void UserControl_KeyDown(object sender, KeyEventArgs e)
        {
            bool AltKey  = Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt);
            bool CtrlKey = Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl);

            if (InitialEntry)
            {
                ApiKeyText.Text = string.Empty;
            }

            InitialEntry = false;

            switch (e.Key)
            {
            case Key.Escape:
            {
                e.Handled = true;
            }
            break;

            case Key.Enter:
            {
                OnOKEvent?.Invoke();
                e.Handled = true;
            }
            break;

            default:
                break;
            }
        }
        private void ApiKeyText_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Escape:
            {
                ApiKeyText.Text = string.Empty;
                e.Handled       = true;
            }
            break;

            case Key.Enter:
            {
                OnOKEvent?.Invoke();
                e.Handled = true;
            }
            break;

            default:
                break;
            }
        }
 private void OnOKButtonClicked(object Sender, RoutedEventArgs EventArgs)
 {
     OnOKEvent?.Invoke();
 }