Twitter GitHub Facebook Instagram dirv.me

Daniel Irvine on building software

Button.IsDefault on Silverlight

29 January 2011

If you’re like me, you spend a lot of time chastising UI developers for not following standard UI guidelines, like the one which says dialog boxes should have a default button.

Unfortunately, the Silverlight team at Microsoft seemingly don’t know about that. Yes, shockingly, Button.IsDefault does not exist in Silverlight.

If you get stuck because of this, an attached property will sort you out, as usual. Here’s a related discussion and some sample code:

http://stackoverflow.com/questions/2683891/silverlight-4-default-button-service

Attached properties really are the unsung heroes of the WPF/Silverlight platform.

About the author

Daniel Irvine is a software craftsman at 8th Light, based in London. These days he prefers to code in Clojure and Ruby, despite having been a C++ and C# developer for the majority of his career.

For a longer bio please see danielirvine.com. To contact Daniel, send a tweet to @d_ir or use the comments section below.

Twitter GitHub Facebook Instagram dirv.me