How to handle both the KeyDown and KeyUp events in a Silverlight 3 TextBox

Posted by sako73 on Stack Overflow See other posts from Stack Overflow or by sako73
Published on 2010-04-20T20:10:06Z Indexed on 2010/04/20 20:13 UTC
Read the original article Hit count: 435

I am attaching handlers to the KeyDown and KeyUp events of a Silverlight 3 TextBox as so:

_masterTextBox.KeyDown += (s, args) =>
{
     CheckForUserEnteredText(MasterTextBox.Text);
     args.Handled = false;
};

_masterTextBox.KeyUp += (s, args) => { UpdateText(MasterTextBox.Text); };

When I comment out the KeyDown handler, then the KeyUp will trap the event, otherwise, only the KeyDown handler is triggered.

Can someone explain why the KeyUp event handler is not firing after the KeyDown handler does?

Thanks.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about silverlight-3.0