Control element of type MobileButton

Defines a button that executes an action or launches a task pane and that appears only on mobile platforms.

Note

This article assumes familiarity with the basic Control reference article which contains important information about the element's attributes.

A mobile button performs a single action when the user selects it. It can either execute a function or show a task pane. Each button control must have an id attribute value that is unique among all <Control> elements in the manifest.

Add-in type: Mail

Valid only in these VersionOverrides schemas:

  • Mail 1.1

The MobileButton value for xsi:type is defined in VersionOverrides schema 1.1. The containing VersionOverrides element must have an xsi:type attribute value of VersionOverridesV1_1.

For more information, see Version overrides in the add-in only manifest.

Associated with these requirement sets:

Child elements

Element Required Description
Label Yes The text for the button.
Icon Yes An image for the button.
Action Yes Specifies the action to perform. There can be only one <Action> child of a <Control> element.

Label

Specifies the text for the button by means of its only attribute, resid, which can be no more than 32 characters and must be set to the value of the id attribute of a <String> element in the <ShortStrings> child of the Resources element.

Add-in type: Mail

Valid only in these VersionOverrides schemas:

  • Mail 1.1

For more information, see Version overrides in the add-in only manifest.

Associated with these requirement sets:

Examples

In the following example, the button executes a function.

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

In the following example, the button displays a task pane.

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