Caliburn Micro Binding KeyDown Event

<TextBox x:Name="MyTextBox" TextAlignment="Left" FontSize="10" Width="240" cal:Message.Attach="[Event KeyUp]=[Action ExecuteAction($executionContext)]"/>
public void ExecuteAction(ActionExecutionContext context)
    {
        var eventArgs = (KeyEventArgs)context.EventArgs;
        if (eventArgs.Key != Key.Enter) return; 
        //Execute Actions...
    }

 

你可能感兴趣的:(event)