I was working with a client that wanted to have a default button clicked when an enter key is pressed in a textbox (password box to be more specific) within a Silverlight or WPF application. I didn't think much of it. I'll just listen to the event, bind to the button, and click the button on the enter key event. The listening and binding portion is not very tough with an attached property and a little Silverlight 3 element to element binding love. The tricky part came in when I wanted to cause the button click event to be raised. I ended up having to take a page from Josh Smith http://joshsmithonwpf.wordpress.com/2007/03/09/how-to-programmatically-click-a-button/. Thank you, Josh! This may not be the best way to do this, but it works for me.
...