Share via


Layout XML 項目參考

您可以使用 Layout 項目來定義工作項目表單上的項目出現方式。 您可以定義多種配置來支援不同的用戶端,例如適用於 Visual Studio 的 Windows 用戶端或適用於 Team Web Access 的 Web 用戶端。

若要將項目加入表單,您可以修改工作項目類型的定義。 請參閱 修改或加入自訂工作項目類型 (WIT)

Layout 項目是 FORM 項目的必要子項目。 如需如何使用 Layout 項目的詳細資訊,請參閱設計工作項目表單

結構描述階層架構

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 >

屬性和項目

下列章節說明屬性、子項目和父項目。

屬性

屬性

描述

Target

選擇性 Layout 屬性。

指定要套用配置的用戶端名稱。 該類型為 xs:string。 指定下列其中一個字串:

  • WinForms:將表單套用至 Team Explorer和 Team Explorer Everywhere。

  • Web:將表單套用至 Team Web Access。

MinimumSize

選擇性 Layout 屬性。

指定表單的最小像素大小。 指定的語法為 (寬度, 高度)。 屬性類型為 SizeType。

模式值:^\(\d+\,\d+\)$

模式值範例:(100,100)

Padding

選擇性 Layout 屬性。

指定表單內框線周圍的空間量 (以像素為單位)。 屬性類型為 SizeType。

模式值:^\(\d+\,\d+\,\d+\,\d+\)$

模式值範例:(2,0,2,0)

Margin

選擇性 Layout 屬性。

指定表單外框線周圍的空間量 (以像素為單位)。 屬性類型為 SizeType。

模式值:^\(\d+\,\d+\,\d+\,\d+\)$

模式值範例:(2,0,2,0)

ControlSpacing

選擇性 Layout 屬性。

指定表單中定義的控制項垂直位移。

LabelSpacing

選擇性 Layout 屬性。

指定標籤和控制項編輯區域之間的像素數。

HideControlBorders

選擇性 Layout 屬性。

指定 True 值可隱藏控制項框線,指定 False 則顯示控制項框線。

HideReadOnlyEmptyFields

選擇性 Layout 屬性。

指定 True 值可隱藏唯讀和空白欄位,指定 False 可顯示這兩個欄位。

子項目

項目

描述

群組

選擇項。 定義要一起顯示在表單上的一組項目。

控制項

選擇項。 定義要顯示在工作項目表單中的工作項目欄位、文字、超連結或其他控制項項目。

TabGroup

選擇項。 包含一或數個 Tab 項目。

Splitter

選擇項。 定義表單上同層級表單項目之間的分隔器及其方向。

父項目

項目

描述

FORM

必要項。 包含 Layout 項目,可定義要如何顯示工作項目類型表單上的項目。

備註

Layout 項目是 FORM 的必要子項目。 Layout 項目會指定一個選項,而且必須定義下列至少其中一個子項目:Group、Control、TabGroup 或 Splitter。 您可以定義一個以上的子項目。

minOccurs="1"

maxOccurs="unbounded"

範例

<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>

項目資訊

命名空間

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

結構描述名稱

工作項目類型定義

驗證檔

WorkItemTypeDefinition.xsd

項目類型

LayoutType 複雜類型

可以是空白

請參閱

參考

Control XML 項目參考

概念

指定工作項目表單控制項

所有 FORM XML 項目參考

設計工作項目表單