Determining the Enter key is pressed in a TextBox

Viewed 28115

Consider a XAML TextBox in Win Phone 7.

  <TextBox x:Name="UserNumber"   />

The goal here is that when the user presses the Enter button on the on-screen keyboard, that would kick off some logic to refresh the content on the screen.

I'd like to have an event raised specifically for Enter. Is this possible?

  • Is the event specific to the TextBox, or is it a system keyboard event?
  • Does it require a check for the Enter on each keypress? i.e. some analog to ASCII 13?
  • What's the best way to code this requirement?

alt text

5 Answers
Related