共用方式為


Layout XML Element Reference

You can use the Layout element to define how the elements on the work item form appear. You can define more than one layout to support different clients, such as the Windows client for Visual Studio or the web client for Team Web Access.

To add elements to a form, you modify the definition for a work item type. See Modify or add a custom work item type (WIT).

The Layout element is a required child element of the FORM element. For more information about how to use the Layout element, see Design the work item form.

Schema Hierarchy

WITD

   WORKITEMTYPE

       FORM

           Layout

<Layout Target="ClientName" MinimumSize="(width,height)" Padding="(left, top, right, bottom)" 
Margin="(left, top, right, bottom)" ControlSpacing="distance" LabelSpacing="distance" HideControlBorders="True | False"
HideReadOnlyEmptyFields="true | false">
    <Group> . . . </Group>
    <Control> . . . </Control>
    <TabGroup> . . . </TabGroup>
    <Splitter> . . . </Splitter>
</Layout >

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

Target

Optional Layout attribute.

Specifies the name of the client to which the layout applies. The type is xs:string. Specify one of the following strings:

  • WinForms: Applies the form to Team Explorer and Team Explorer Everywhere.

  • Web: Applies the form to Team Web Access.

MinimumSize

Optional Layout attribute.

Specifies the minimum size in pixels for the form. The syntax is specified in (width, height). The attribute type is SizeType.

Pattern value: ^\(\d+\,\d+\)$

Pattern value example: (100,100)

Padding

Optional Layout attribute.

Specifies the amount of space in pixels around the inside border of the form. The attribute type is SizeType.

Pattern value: ^\(\d+\,\d+\,\d+\,\d+\)$

Pattern value example: (2,0,2,0)

Margin

Optional Layout attribute.

Specifies the amount of space in pixels around the outside border of the form. The attribute type is SizeType.

Pattern value: ^\(\d+\,\d+\,\d+\,\d+\)$

Pattern value example: (2,0,2,0)

ControlSpacing

Optional Layout attribute.

Specifies the vertical offset of controls defined in the form.

LabelSpacing

Optional Layout attribute.

Specifies the number of pixels between the label and the edit region of the control.

HideControlBorders

Optional Layout attribute.

Specify a value of True to hide control borders, and False to display control borders.

HideReadOnlyEmptyFields

Optional Layout attribute.

Specify a value of true to hide read-only and empty fields, and false to display these fields.

Child Elements

Element

Description

Group

Optional. Defines a group of elements to display together on the form.

Control

Optional. Defines a work item field, text, hyperlink, or other control element to display in a work item form.

TabGroup

Optional. Contains one or more Tab elements.

Splitter

Optional. Defines a splitter and its orientation on the form between sibling form elements.

Parent Elements

Element

Description

FORM

Required. Contains the Layout element that defines how the elements on the work item type form are displayed.

Remarks

The Layout element is a required child element of FORM. The Layout element specifies a choice, and at least one of the child elements must be defined: Group, Control, TabGroup, or Splitter. You can define more than one child element.

minOccurs="1"

maxOccurs="unbounded"

Example

<FORM>
   <Layout>
      <Group>
          <Column PercentWidth="36">
            <Group>
            <Control FieldName="System.Title" Type="FieldControl" Label="Title" LabelPosition="Left" />
            <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="Area" LabelPosition="Left" />
            <Control FieldName="Microsoft.VSTS.Common.ProductUnit" Type="FieldControl" Label="Product Unit" LabelPosition="Left" />
            <Control FieldName="Microsoft.DevDiv.BusinessUnit" Type="FieldControl" Label="Business Unit" LabelPosition="Left" />
            </Group>
          </Column>
          <Column PercentWidth="33">
            <Group>
            <Control FieldName="Microsoft.DevDiv.SubTitle" Type="FieldControl" Label="Sub Title" LabelPosition="Left" />
            <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Iteration" LabelPosition="Left" />
            <Control FieldName="Microsoft.DevDiv.Other" Type="FieldControl" Label="Other" LabelPosition="Left" />
            </Group>
          </Column>
          <Column PercentWidth="31">
            <Group>
            <Control FieldName="Microsoft.DevDiv.Type" Type="FieldControl" Label="Type" LabelPosition="Left" />
            <Control FieldName="System.AssignedTo" Type="FieldControl" Label="Assigned To" LabelPosition="Left" />
            <Control FieldName="System.State" Type="FieldControl" Label="State" LabelPosition="Left" />
            </Group>
          </Column>
      </Group>
. . .
   </Layout>
</FORM>

Element Information

Namespace

https://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef

Schema Name

Work Item Type Definition

Validation File

WorkItemTypeDefinition.xsd

Element Type

LayoutType Complex Type

Can Be Empty

No

See Also

Reference

Control XML element reference

Concepts

Specify work item form controls

All FORM XML elements reference

Design the work item form