ChatterBox.Client.Presentation.Shared.Behaviors.ReturnKeyCommandBehavior.HandleKeyDown C# (CSharp) Method

HandleKeyDown() private static method

private static HandleKeyDown ( object sender, KeyRoutedEventArgs e ) : void
sender object
e Windows.UI.Xaml.Input.KeyRoutedEventArgs
return void
        private static void HandleKeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == VirtualKey.Enter)
            {
                _isEnterPressed = true;
                var cmd = ((UIElement) sender).GetValue(CommandProperty) as ICommand;
                if (cmd != null && cmd.CanExecute(null))
                {
                    _command = cmd;
                }
            }
        }