Share via


SizeDefinition 要素

リボン コントロールのカスタム レイアウト テンプレートを表します。

使用

<SizeDefinition
  Name = "xs:positiveInteger or xs:string or xs:token">
  child elements
</SizeDefinition>

属性

属性 Type 必須 説明
Name
xs:positiveInteger または xs:string または xs:token
はい
Ribbon.SizeDefinitions が親である場合は 、それ以外の場合は省略可能です。

(xs:positiveInteger または xs:string または xs:token)
文字列または 2 ~ 59999 の整数値 (16 進数を含む) または0x2と0xea5f。
値は、リボン XML ドキュメント内で一意である必要があります。
最大長: 100 文字。

子要素

要素 説明
ControlNameMap
最大で 1 回発生する可能性があります

GroupSizeDefinition
少なくとも 1 回は発生する必要があります

親要素

要素
グループ
Ribbon.SizeDefinitions

解説

省略可能。

Group 要素ごとに最大で 1 回発生する可能性があります。

Ribbon.SizeDefinitions 要素ごとに 1 回以上発生する可能性があります。

定義済みのリボン フレームワーク レイアウト テンプレートは、Group 要素の SizeDefinition 属性で指定されます。

対応する ScalingPolicy.IdealSizes 要素が Tab 要素の Group 要素ごとに宣言されていない場合は、検証エラーが発生します。

次のコード例は、基本的なカスタム テンプレートを示しています。

<Group CommandName="cmdButtonGroup2">
  <SizeDefinition>
    <ControlNameMap>
      <ControlNameDefinition Name="button1"/>
      <ControlNameDefinition Name="button2"/>
      <ControlNameDefinition Name="button3"/>
      <ControlNameDefinition Name="button4"/>
    </ControlNameMap>
    <GroupSizeDefinition Size="Large">
      <ControlGroup>
        <ControlSizeDefinition ControlName="button1"
                               ImageSize="Large"
                               IsLabelVisible="true" />
        <ControlSizeDefinition ControlName="button2"
                               ImageSize="Large"
                               IsLabelVisible="true" />
      </ControlGroup>
      <ColumnBreak ShowSeparator="true"/>
      <ControlGroup>
        <ControlSizeDefinition ControlName="button3"
                               ImageSize="Large"
                              IsLabelVisible="true" />
        <ControlSizeDefinition ControlName="button4"
                              ImageSize="Large"
                              IsLabelVisible="true" />
      </ControlGroup>
    </GroupSizeDefinition>
    <GroupSizeDefinition Size="Medium">
      <Row>
        <ControlSizeDefinition ControlName="button1"
                               ImageSize="Small"
                               IsLabelVisible="true" />
        <ControlSizeDefinition ControlName="button3"
                               ImageSize="Small"
                               IsLabelVisible="true" />
      </Row>
      <Row>
        <ControlSizeDefinition ControlName="button2"
                               ImageSize="Small"
                               IsLabelVisible="true" />
        <ControlSizeDefinition ControlName="button4"
                               ImageSize="Small"
                               IsLabelVisible="true" />
      </Row>
    </GroupSizeDefinition>
    <GroupSizeDefinition Size="Small">
      <Row>
        <ControlSizeDefinition ControlName="button1"
                               ImageSize="Small"
                               IsLabelVisible="true" />
        <ControlSizeDefinition ControlName="button3"
                               ImageSize="Small"
                               IsLabelVisible="false" />
      </Row>
      <Row>
        <ControlSizeDefinition ControlName="button2"
                               ImageSize="Small"
                               IsLabelVisible="true" />
        <ControlSizeDefinition ControlName="button4"
                               ImageSize="Small"
                               IsLabelVisible="false" />
      </Row>
    </GroupSizeDefinition>
  </SizeDefinition>
  <Button CommandName="cmdButtonG21"></Button>
  <Button CommandName="cmdButtonG22"></Button>
  <Button CommandName="cmdButtonG23"></Button>
  <Button CommandName="cmdButtonG24"></Button>
</Group>
<Group CommandName="cmdCheckBoxGroup">
  <CheckBox CommandName="cmdCheckBox"></CheckBox>
</Group>
<Group CommandName="cmdToggleButtonGroup"
       SizeDefinition="OneButton">
  <ToggleButton CommandName="cmdToggleButton"></ToggleButton>
</Group>
<Group CommandName="cmdButtonGroup"
       SizeDefinition="ThreeButtons">
  <Button CommandName="cmdButton1"></Button>
  <Button CommandName="cmdButton2"></Button>
  <Button CommandName="cmdButton3"></Button>
</Group>

要素情報

  • サポートされている最小システム: Windows 7
  • 空にできます: いいえ

関連項目

サイズ定義とスケーリング ポリシーを使用したリボンのカスタマイズ