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!

No comments:

Post a Comment