Before looking to the official document, the layout has been completed in view of only xafm document. The original properties may be provided directly DetailViewLayoutAttribute code.
Pre-layout
The effect of pre-layout
Pre-layout source code
1 public class Contact { 2 [Browsable(false)] 3 public int ID { get; private set; } 4 public string FirstName { get; set; } 5 public string LastName { get; set; } 6 public string FullName { 7 get { return FirstName + " " + LastName; } 8 } 9 public string Email { get; set; } 10 public virtual Contact Manager { get; set; } 11 public DateTime? Birthday { get; set; } 12 [FieldSize(FieldSizeAttribute.Unlimited)] 13 public string Notes { get; set; } 14 [FieldSize(FieldSizeAttribute.Unlimited)] 15 public string Remarks { get; set; } 16 }
After layout
After the layout effect
After the layout of the source code
1 public class Contact { 2 [Browsable(false)] 3 public int ID { get; private set; } 4 [DetailViewLayoutAttribute(LayoutColumnPosition.Left)] 5 //左侧 6 public string FirstName { get; set; } 7 [DetailViewLayoutAttribute(LayoutColumnPosition.Right)] 8 //右侧 9 public string LastName { get; set; } 10 [DetailViewLayoutAttribute("FullName", 0)] 11 //占一行 12 public string FullName { 13 get { return FirstName + " " + LastName; } 14 } 15 [DetailViewLayoutAttribute(LayoutColumnPosition.Left)] 16 public string Email { get; set; } 17 [DetailViewLayoutAttribute(LayoutColumnPosition.Right)] 18 public virtual Contact Manager { get; set; } 19 [DetailViewLayoutAttribute(LayoutColumnPosition.Left)] 20 public DateTime? Birthday { get; set; } 21 [FieldSize(FieldSizeAttribute.Unlimited)] 22 [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)] 23 public string Notes { get; set; } 24 [FieldSize(FieldSizeAttribute.Unlimited)] 25 [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)] 26 public string Remarks { get; set; } 27 }
Reference Site