Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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"
          Name="CellType"
          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
add comment

1 Answer

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: https://groups.google.com/group/wpf-disciples/web/wpf-and-xaml-coding-guidelines?hl=en. 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
add comment

Your Answer

 
discard

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.