MobileButton 类型的 Control 元素

定义执行操作或启动任务窗格且仅在移动平台上显示的按钮。

注意

本文假定熟悉基本 控件参考文章 ,其中包含有关元素属性的重要信息。

当用户选择某个移动按钮时,将执行一个操作。 它可以执行函数或显示任务窗格。 每个按钮控件必须具有在清单中的所有 <Control> 元素中唯一id的属性值。

外接程序类型: 邮件

仅在以下 VersionOverrides 架构中有效

  • 邮件 1.1

在 VersionOverrides 架构 1.1 中定义了 MobileButton 值。 包含 VersionOverrides 元素的 xsi:type 属性值必须为 VersionOverridesV1_1

有关详细信息,请参阅 清单中的版本替代

与以下要求集关联

子元素

元素 必需 说明
Label 按钮文本。
Icon 按钮的图像。
Action 指定要执行的操作。 Control 元素只能有一<个><Action 子元素。>

标签

通过按钮的唯一属性来指定该按钮的文本,属性不能超过 32 个字符,并且必须设置为 Resources元素的<>ShortStrings> 子元素的<id 属性的值。

外接程序类型: 邮件

仅在以下 VersionOverrides 架构中有效

  • 邮件 1.1

有关详细信息,请参阅 清单中的版本替代

与以下要求集关联

示例

在以下示例中, 按钮执行函数。

<Control xsi:type="MobileButton" id="Contoso.msgReadFunctionButton">
  <Label resid="funcReadButtonLabel" />
  <Icon>
    <bt:Image resid="blue-icon-16-1" size="25" scale="1" />
    <bt:Image resid="blue-icon-16-2" size="25" scale="2" />
    <bt:Image resid="blue-icon-16-3" size="25" scale="3" />
    <bt:Image resid="blue-icon-32-1" size="32" scale="1" />
    <bt:Image resid="blue-icon-32-2" size="32" scale="2" />
    <bt:Image resid="blue-icon-32-3" size="32" scale="3" />
    <bt:Image resid="blue-icon-80-1" size="48" scale="1" />
    <bt:Image resid="blue-icon-80-2" size="48" scale="2" />
    <bt:Image resid="blue-icon-80-3" size="48" scale="3" />
  </Icon>
  <Action xsi:type="ExecuteFunction">
    <FunctionName>getSubject</FunctionName>
  </Action>
</Control>

在以下示例中,按钮显示任务窗格。

<Control xsi:type="MobileButton" id="Contoso.msgReadOpenPaneButton">
  <Label resid="paneReadButtonLabel" />
  <Icon>
    <bt:Image resid="blue-icon-16-1" size="25" scale="1" />
    <bt:Image resid="blue-icon-16-2" size="25" scale="2" />
    <bt:Image resid="blue-icon-16-3" size="25" scale="3" />
    <bt:Image resid="blue-icon-32-1" size="32" scale="1" />
    <bt:Image resid="blue-icon-32-2" size="32" scale="2" />
    <bt:Image resid="blue-icon-32-3" size="32" scale="3" />
    <bt:Image resid="blue-icon-80-1" size="48" scale="1" />
    <bt:Image resid="blue-icon-80-2" size="48" scale="2" />
    <bt:Image resid="blue-icon-80-3" size="48" scale="3" />
  </Icon>
  <Action xsi:type="ShowTaskpane">
    <SourceLocation resid="readTaskPaneUrl" />
  </Action>
</Control>