Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started coding WPF applications a several months ago and now I am asking myself if there are some style guides for XAML. I do not need to get explained the benefits of Binding, Converters, Styles, Templates etc. My question is more basically.

Is there an official (or unofficial) „best practice“ about the order of attributes etc:

For instance:

<ComboBox Grid.Column="0" Grid.Row="0"
          ItemsSource="{Binding EditorTypes}"
          SelectedItem="{Binding EditorType}">

Is there something like

  • always attached properties first [last]
  • always declare a column [row] in a Grid, even if there is only one

Are there some rules/guides I should read to make my code look more common?

share|improve this question
possible duplicate of What's the recommended control naming convention for XAML markup? – Matthieu Feb 9 '12 at 16:06
up vote 4 down vote accepted

There is no "official" best practice rules. There is however a Google Group that wants to establish these best practices: There even are some propositions on how to organize these files for bigger projects (company scale)

Their propositions look reasonable.

share|improve this answer
Yes, this is what I was looking for :-) – Markus Aug 26 '11 at 7:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.