MobileButton 类型的控制元素

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

注意

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

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

外接程序类型: 邮件

仅在以下 VersionOverrides 架构中有效:

  • 邮件 1.1

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

有关详细信息,请参阅仅加载 项清单中的版本替代。

与以下要求集关联:

子元素

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

标签

通过其唯一属性 resid(最多可以超过 32 个字符)指定按钮的文本,并且必须设置为 Resources 元素的 ShortStrings> 子项中<String> 元素的<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>