Microsoft.Windows.Controls.Ribbon.RibbonTextBox.OnKeyDown C# (CSharp) Method

OnKeyDown() protected method

Invoked each time a key-down event occurs. When key-down occurs we check to see if that key was 'Enter', and if so we invoke the associated Command.
protected OnKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs A KeyEventArgs that contains the event data.
return void
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyUp(e);

            if (e.Key == Key.Enter)
            {
                CommandHelpers.InvokeCommandSource(CommandParameter, null, this, CommandOperation.Execute);

                // Dismiss parent Popups
                RaiseEvent(new RibbonDismissPopupEventArgs());
            }
        }