Skip to content
apohl1111 edited this page Nov 3, 2011 · 20 revisions

XAML

Root Order:

  1. x:Name, x:Class
  2. All references, maximum 2 per line
  3. Design properties (Ex. mc:Ignorable="d" d:DesignWidth="230" Foreground="Blue")
  4. ViewModelLocator?
  5. Bindings

Rules:

-Wrap lines when they pass more the longest reference line

Controls order:

  1. x:Name
  2. Design properties
  3. Bindings

Silverlight

The FoundOps code structure is broken into these sections

Code Structure

1-2 of something: use //

3 or more of something: use #region

All comments should start capitalized and use proper punctuation.

Class Structure:

//Summary

Properties & Variables

-Public

-Protected

-Locals

Constructors (least parameters => most parameters)

Logic(Always in a region)

Example property:

//Summary

private int _num

public int Num

{

get{...}

set{...}

}

Logic Code Organization

  1. Code Execution
  2. Alphabetically

Example code execution section:

Section explanation

1st called method

2nd method called

{

inner method A

inner method B

}

Using Statements

Try to keep in order of shortest to longest

Ex.
c# .Select(_ => true)

Easy Mistakes

Confusing seconds and milliseconds when using RX TimeSpan.
Ex. TimeSpan(0,0,2) is 2 seconds and TimeSpan(0, 0, 0, 0, 300) is 300 milliseconds.
See [http://msdn.microsoft.com/en-us/library/system.timespan.aspx](this link) for more information.

Clone this wiki locally