Thursday, May 26, 2011

Name your Parts, Don't throw null-ref-exceptions.

Name the parts of your controls with 'PART_' prefix and set the attribute:
[TemplatePart(Name = "PART_", Type = typeof())]
Always set the type to the lower possible class in the class hierarchy. Don't use Button if ButtonBase would work!

Wednesday, May 25, 2011

CheckBox's content be clickable too

I hate clicking the text near a checkbox or radio button and the damn thing is not checking.