Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAML resource naming convention

We are deciding if we should standardize on camelCase or PascalCase for XAML resource names.

Does anybody know if one style is usually favored over the other?

Does Microsoft have any convention for this?

For the record, we use camelCase for fields (that includes WPF controls, in the very few cases where they are named)

To avoid religious arguments: I'm not looking for "this approach is BETTER than the other because..." responses. A good answer would include links to reference material and/or statistics.

like image 663
Diego Mijelshon Avatar asked Jun 23 '11 16:06

Diego Mijelshon


1 Answers

For the x:Name attribute, you should use camel casing, as this generally results in a field being created behind the scenes. Microsoft, doesn't really follow this though in their default Styles, as control templates are one exception where a backing field is not created.

For the x:Key attribute, I've only ever seen pascal casing used. This includes in Microsoft's default Styles.

like image 145
CodeNaked Avatar answered Oct 31 '22 11:10

CodeNaked