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...
    }

 

posted on 2014-01-05 01:33  蔚蓝海  阅读(483)  评论(0编辑  收藏  举报