SecondaryTile SecondaryTile SecondaryTile SecondaryTile Class

Definition

Creates, enumerates, and provides information about a secondary tile.

public : sealed class SecondaryTile : ISecondaryTile, ISecondaryTile2public sealed class SecondaryTile : ISecondaryTile, ISecondaryTile2Public NotInheritable Class SecondaryTile Implements ISecondaryTile, ISecondaryTile2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following example creates and pins a secondary tile to the Start screen.


// Prepare package images for use as the Tile Logo and Small Logo in our tile to be pinned.
var uriLogo = new Windows.Foundation.Uri("ms-appx:///images/SecondaryTileDefault-sdk.png");
var uriSmallLogo = new Windows.Foundation.Uri("ms-appx:///images/smallLogoSecondaryTile-sdk.png");

// Create a tile to be be pinned.

// During creation of secondary tiles, an application can set additional arguments on the tile 
// that will be passed in during activation. These arguments should be meaningful to the application. 
// In this example, we'll pass in the date and time that the Secondary Tile was pinned.
var currentTime = new Date();
var tileActivationArguments = "timeTileWasPinned=" + currentTime;

// Specify the short name to display on the tile, the display name, arguments to be passed in 
// during activation, attributes regarding how to display the tile by default, and the tile logo.
// Note that you should pick a unique ID that is descriptive and meaningful to your application. 
// In this case, we explicitly code a single ID to focus our attention on the pinning operation.

var tile = new Windows.UI.StartScreen.SecondaryTile("SecondaryTile.01", 
                                                    "A Secondary Tile", 
                                                    "Secondary Tile Sample Secondary Tile", 
                                                    tileActivationArguments, 
                                                    Windows.UI.StartScreen.TileOptions.showNameOnLogo, 
                                                    uriLogo);

// Specify a foreground text value.
// The secondary tile background color over which this text is shown is inherited from the 
// parent app unless a separate value is specified.
tile.foregroundText = Windows.UI.StartScreen.ForegroundText.dark;

// The small tile logo is inherited from the parent app unless overridden as we do here.
tile.smallLogo = uriSmallLogo;

// Attempt to pin the tile.
// Note that the status message is updated when the async operation to pin the tile completes.

tile.requestCreateAsync().then(function (isCreated) {
    if (isCreated) {
        // Secondary tile successfully pinned.
    } else {
        // Secondary tile not pinned.
    }
});

The following example demonstrates how to delete (unpin) a secondary tile by using the RequestDeleteAsync method. Note that this example assumes that the tile exists. To determine whether the tile is pinned before you call RequestDeleteAsync, see the Exists method.


// Specify the secondary tile to be deleted, using the ID that it was given when it was originally created.
var tileToBeDeleted = new Windows.UI.StartScreen.SecondaryTile("SecondaryTile.01");

// Make the delete request.
tileToBeDeleted.requestDeleteAsync().then(function (isDeleted) {
    if (isDeleted) {
        // Secondary tile successfully deleted.
    } else {
        // Secondary tile not deleted.
    }
});

The following example demonstrates how to use the FindAllForPackageAsync method to retrieve a list of IDs for all secondary tiles created for the calling app and any other app in the same package.


Windows.UI.StartScreen.SecondaryTile.findAllForPackageAsync().done(function (tiles) {
    tiles.forEach(function (tile) {
        var myTileId = tile.tileId;
        // Continue to process as necessary.
    });
});

The following example demonstrates how to use the TileUpdateManager.createTileUpdaterForSecondaryTile method to send a notification to a secondary tile with an ID of "SecondaryTile.Dynamic". Note that the example provides both a wide and square version of the notification because the user has control over which form of the tile is showing.


var notifications = Windows.UI.Notifications;

// Define the notification content.
var tileXml = notifications.TileUpdateManager.getTemplateContent(notifications.TileTemplateType.tileWide310x150Text04);
var tileTextAttributes = tileXml.getElementsByTagName("text");
tileTextAttributes[0].appendChild(tileXml.createTextNode("Sent to a secondary tile!"));

// Provide a square version of the notification.
var squareTileXml = notifications.TileUpdateManager.getTemplateContent(notifications.TileTemplateType.tileSquare150x150Text04);
var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("Sent to a secondary tile!"));

// Add the medium tile to the notification.
var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
tileXml.getElementsByTagName("visual").item(0).appendChild(node);

// Create the notification based on the XML content.
var tileNotification = new notifications.TileNotification(tileXml);

// Create a secondary tile updater, passing it the ID of the tile.
var tileUpdater = notifications.TileUpdateManager.createTileUpdaterForSecondaryTile("SecondaryTile.Dynamic");

// Send the notification to the secondary tile.
tileUpdater.update(tileNotification);

The following example demonstrates how to use the BadgeUpdateManager.createBadgeUpdaterForSecondaryTile method to send a numeric badge notification to a secondary tile with an ID of "SecondaryTile.Dynamic".


var notifications = Windows.UI.Notifications;

// Define the badge content
var badgeNotification = notifications.BadgeUpdateManager.getTemplateContent(notifications.BadgeTemplateType.badgeNumber);
var badgeAttributes = badgeNotification.getElementsByTagName("badge");
badgeAttributes[0].setAttribute("value", "6");

// Create the notification based on the XML content.
var badge = new notifications.BadgeNotification(badgeNotification);

// Create a secondary tile updater, passing it the ID of the tile.
notifications.BadgeUpdateManager.createBadgeUpdaterForSecondaryTile("SecondaryTile.Dynamic");

// Send the notification to the secondary tile.
tileUpdater.update(tileNotification);

Constructors

SecondaryTile() SecondaryTile() SecondaryTile() SecondaryTile()

SecondaryTile(String) SecondaryTile(String) SecondaryTile(String) SecondaryTile(String)

Creates a SecondaryTile object with a specific ID. This form of the constructor should be used to create a secondary tile object to perform a tile update or deletion.

public : SecondaryTile(PlatForm::String tileId)public SecondaryTile(String tileId)Public Sub New(tileId As String)// You can use this method in JavaScript.
Parameters
tileId
PlatForm::String String String String

A string that will uniquely identify the tile within your app. Choose a unique ID that is descriptive and meaningful to your app. If you provide the same ID as that of an existing secondary tile, the existing secondary tile will be overwritten.

Remarks

The unique ID that you use to create this tile can be used later update or delete it.

Other mandatory tile properties, such as the display name, must be set through calls to other methods of this class before the tile can be activated.

See Also

SecondaryTile(String, String, String, String, TileOptions, Uri) SecondaryTile(String, String, String, String, TileOptions, Uri) SecondaryTile(String, String, String, String, TileOptions, Uri) SecondaryTile(String, String, String, String, TileOptions, Uri)

Note

This constructor may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTile.SecondaryTile(String, String, String, Uri, TileSize).

Creates a SecondaryTile object as a medium tile.

public : SecondaryTile(PlatForm::String tileId, PlatForm::String shortName, PlatForm::String displayName, PlatForm::String arguments, TileOptions tileOptions, Uri logoReference)public SecondaryTile(String tileId, String shortName, String displayName, String arguments, TileOptions tileOptions, Uri logoReference)Public Sub New(tileId As String, shortName As String, displayName As String, arguments As String, tileOptions As TileOptions, logoReference As Uri)// You can use this method in JavaScript.
Parameters
tileId
PlatForm::String String String String

A string that will uniquely identify the tile within your app's package. Choose a unique ID that is descriptive and meaningful to your app. It is limited to 64 characters and must begin with a number or letter and be composed of the characters a-z, A-Z, 0-9, period (.), or underscore (_). If you provide the same ID as that of an existing secondary tile, the existing secondary tile will be overwritten. Can be set or retrieved through the TileId property.

shortName
PlatForm::String String String String

A short name to display directly on the tile if the app chooses to do so. Anything over 40 characters will be truncated. The user has the option to change this value as part of the pinning process. Can be set or retrieved through the ShortName property.

Note

This value is only used in Windows 8 and is deprecated in favor of the displayName in later versions.

displayName
PlatForm::String String String String

A name to be displayed on the tile, in the tile's tooltip, and when showing small tiles, such as on the Apps or search results screens. This string is equivalent to the display name given in the manifest for the main tile. It is restricted to 256 characters, but in practice should be kept short to avoid truncation. This value can be set or retrieved through the DisplayName property.

The display name is shown only on the wide secondary tile on Windows Phone 8.1.

arguments
PlatForm::String String String String

An app-defined string meaningful to the calling application. This argument string is passed back to the app when the app is activated from the secondary tile. It will be truncated after 2048 characters. Can be set or retrieved through the Arguments property.

tileOptions
TileOptions TileOptions TileOptions TileOptions

A value that specifies various options such as whether the name will be displayed on the secondary tile. Can be set or retrieved through the TileOptions property.

logoReference
Uri Uri Uri Uri

A reference to a square logo image stored at a Uniform Resource Identifier (URI). Can be set or retrieved through the Logo property. This value can be expressed using one of these schemes: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.ms-appdata:///local/A file found in the per-user app storage.

See Also

SecondaryTile(String, String, String, String, TileOptions, Uri, Uri) SecondaryTile(String, String, String, String, TileOptions, Uri, Uri) SecondaryTile(String, String, String, String, TileOptions, Uri, Uri) SecondaryTile(String, String, String, String, TileOptions, Uri, Uri)

Note

This constructor may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTile.SecondaryTile(String, String, String, Uri, TileSize) and supply other tile sizes and options through SecondaryTile.VisualElements method.

Creates a SecondaryTile object as a wide tile.

On Windows Phone 8.1, all tiles— including secondary tiles— are pinned at as medium tiles, after which they can be resized by the user. This constructor provides that option of resizing to a wide tile.

public : SecondaryTile(PlatForm::String tileId, PlatForm::String shortName, PlatForm::String displayName, PlatForm::String arguments, TileOptions tileOptions, Uri logoReference, Uri wideLogoReference)public SecondaryTile(String tileId, String shortName, String displayName, String arguments, TileOptions tileOptions, Uri logoReference, Uri wideLogoReference)Public Sub New(tileId As String, shortName As String, displayName As String, arguments As String, tileOptions As TileOptions, logoReference As Uri, wideLogoReference As Uri)// You can use this method in JavaScript.
Parameters
tileId
PlatForm::String String String String

A string that will uniquely identify the tile within your app's package. Choose a unique ID that is descriptive and meaningful to your app. It is limited to 64 characters and must begin with a number or letter and be composed of the characters a-z, A-Z, 0-9, period (.), or underscore (_). If you provide the same ID as that of an existing secondary tile, the existing secondary tile will be overwritten. Can be set or retrieved through the TileId property.

shortName
PlatForm::String String String String

A short name to display directly on the tile if the app chooses to do so. Anything over 40 characters will be truncated. The user has the option to change this value as part of the pinning process. Can be set or retrieved through the ShortName property.

Note

This value is used only in Windows 8 and is deprecated in favor of the displayName in later versions.

displayName
PlatForm::String String String String

A name to be displayed on the tile, in the tile's tooltip, and when showing small tiles, such as on the Apps or search results screens. This string is equivalent to the display name given in the manifest for the main tile. It is restricted to 256 characters, but in practice should be kept short to avoid truncation. This value can be set or retrieved through the DisplayName property.

The display name is shown only on the wide secondary tile on Windows Phone 8.1.

arguments
PlatForm::String String String String

An app-defined string meaningful to the calling application. This argument string is passed back to the app when the app is activated from the secondary tile. It will be truncated after 2048 characters. Can be set or retrieved through the Arguments property.

tileOptions
TileOptions TileOptions TileOptions TileOptions

A value that specifies various options such as whether the name will be displayed on the secondary tile. Can be set or retrieved through the TileOptions property.

logoReference
Uri Uri Uri Uri

A reference to a medium logo image stored at a Uniform Resource Identifier (URI). Can be set or retrieved through the Square150x150Logo property. This value can be expressed using one of these schemes: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.ms-appdata:///local/A file found in the per-user app storage.

wideLogoReference
Uri Uri Uri Uri

A reference to a wide logo image stored at a Uniform Resource Identifier (URI). Can be set or retrieved through the WideLogo property. This value can be expressed using one of these schemes: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.ms-appdata:///local/A file found in the per-user app storage.

See Also

SecondaryTile(String, String, String, Uri, TileSize) SecondaryTile(String, String, String, Uri, TileSize) SecondaryTile(String, String, String, Uri, TileSize) SecondaryTile(String, String, String, Uri, TileSize)

Creates a SecondaryTile object that includes all of the mandatory properties required to create a medium tile.

public : SecondaryTile(PlatForm::String tileId, PlatForm::String displayName, PlatForm::String arguments, Uri square150x150Logo, TileSize desiredSize)public SecondaryTile(String tileId, String displayName, String arguments, Uri square150x150Logo, TileSize desiredSize)Public Sub New(tileId As String, displayName As String, arguments As String, square150x150Logo As Uri, desiredSize As TileSize)// You can use this method in JavaScript.
Parameters
tileId
PlatForm::String String String String

A string that will uniquely identify the tile within your app's package. Choose a unique ID that is descriptive and meaningful to your app. It is limited to 64 characters and must begin with a number or letter and be composed of the characters a-z, A-Z, 0-9, period (.), or underscore (_). If you provide the same ID as that of an existing secondary tile, the existing secondary tile will be overwritten. Can be set or retrieved through the TileId property.

displayName
PlatForm::String String String String

A name to be displayed on the tile, in the tile's tooltip, and when showing small tiles, such as on the Apps or search results screens. This string is equivalent to the display name given in the manifest for the main tile. It is restricted to 256 characters, but in practice should be kept short to avoid truncation. This value can be set or retrieved through the DisplayName property.

The display name is shown only on the wide secondary tile on Windows Phone 8.1.

arguments
PlatForm::String String String String

An app-defined string meaningful to the calling application. This argument string is passed back to the app when the app is activated from the secondary tile. It will be truncated after 2048 characters. Can be set or retrieved through the Arguments property.

Note

This parameter must be URL-encoded for Windows Phone Silverlight 8.1 apps. All other app types can use their own structure.

square150x150Logo
Uri Uri Uri Uri

A reference to a medium logo image stored at a Uniform Resource Identifier (URI). Can be set or retrieved through the SecondaryTileVisualElements.Square150x150Logo property. This value can be expressed using one of these schemes: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.ms-appdata:///local/A file found in the per-user app storage.

desiredSize
TileSize TileSize TileSize TileSize

The size of tile to pin. This value must be Default (which provides Windows 8 behavior), Square150x150, or Wide310x150. Any other TileSize value causes an exception to be thrown during runtime.

The desiredSize parameter is ignored on Windows Phone 8.1. On the phone, all tiles— including secondary tiles— are pinned as medium tiles, after which they can be resized by the user.

Examples

The following example demonstrates the use of this constructor.


var uriLogo = new Windows.Foundation.Uri("ms-appx:///images/SecondaryTileDefault-sdk.png");
var currentTime = new Date();
var tileActivationArguments = "timeTileWasPinned=" + currentTime;

var tile = new Windows.UI.StartScreen.SecondaryTile("SecondaryTile.01", 
                                                    "Secondary Tile Sample Secondary Tile", 
                                                    tileActivationArguments, 
                                                    uriLogo,
                                                    Windows.UI.StartScreen.TileSize.square150x150);
See Also

Properties

Arguments Arguments Arguments Arguments

Gets or sets an app-defined set of information that is passed from the secondary tile to the app on activation. This property is required when you create a tile.

public : PlatForm::String Arguments { get; set; }public string Arguments { get; set; }Public ReadWrite Property Arguments As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The argument string, of 2048 or fewer characters. This contents of this string are understood by the app. Any string longer than 2048 characters will cause an exception to be thrown. This string is passed to the app through the LaunchActivatedEventArgs.Arguments property.

Remarks

When an app is activated through this secondary tile (by click, touch, or keyboard), the tile sends this argument string to the app.

See Also

BackgroundColor BackgroundColor BackgroundColor BackgroundColor

Note

BackgroundColor may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTileVisualElements.BackgroundColor.

Gets or sets the tile's background color.

public : Color BackgroundColor { get; set; }public Color BackgroundColor { get; set; }Public ReadWrite Property BackgroundColor As Color// You can use this property in JavaScript.
Value
Color Color Color Color

The background color.

Examples

The following lines show different ways to express the color through this property.


secondaryTile.backgroundColor = Windows.UI.Colors.magenta;

secondaryTile.BackgroundColor = Windows.UI.Color.Magenta;
secondaryTile.BackgroundColor = Windows.UI.Color.FromArgb(255, 255, 255, 255);

secondaryTile->BackgroundColor = Windows::UI::Colors::Magenta;
secondaryTile->BackgroundColor = Windows::UI::ColorHelper::FromArgb(0, 255, 255, 120);

Remarks

If this property is not set, its value is inherited from the background color of the parent app's tile.

See Also

DisplayName DisplayName DisplayName DisplayName

Gets or sets a name that is associated with and displayed on the tile. This name is displayed on the tile in Start, in the tile's tooltip, next to the small tile representation in the Apps list, and in some Control Panel applications. This property is required when you create a tile. It is the equivalent of the display name declared in the manifest for the app's main tile.

On Windows Phone 8.1, the display name is shown only on the wide secondary tile.

public : PlatForm::String DisplayName { get; set; }public string DisplayName { get; set; }Public ReadWrite Property DisplayName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The display name. This string is limited to 256 characters, but in reality should be kept short to avoid truncation.

Remarks

This display name is visible to searches.

See Also

ForegroundText ForegroundText ForegroundText ForegroundText

Note

ForegroundText may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTileVisualElements.ForegroundText.

Gets or sets whether the tile should use dark or light text.

public : ForegroundText ForegroundText { get; set; }public ForegroundText ForegroundText { get; set; }Public ReadWrite Property ForegroundText As ForegroundText// You can use this property in JavaScript.
Value
ForegroundText ForegroundText ForegroundText ForegroundText

One of the two values that specifies either the default dark or default light text.

Remarks

This property is ignored on Windows Phone 8.1.

If this property is not specified, it is inherited from the foreground text property of the parent app's tile.

Only two text colors are available— default dark and default light— and are set by Windows. Choose the text color that will look best with your choice of background color and the opacity of your logo image.

See Also

LockScreenBadgeLogo LockScreenBadgeLogo LockScreenBadgeLogo LockScreenBadgeLogo

Gets or sets the location of a badge logo image to represent the secondary tile on the lock screen. By supplying this image, you declare that the secondary tile is eligible to display a badge on the lock screen. If you also want the secondary tile to be eligible for the lock screen's detailed tile slot, you must also set the LockScreenDisplayBadgeAndTileText property to True.

Note

Stating that your secondary tile is eligible for a lock screen presence does not guarantee that it will have one. Only the user can add an app to one of the seven lock screen slots. For more information, see the Lock screen overview.

public : Uri LockScreenBadgeLogo { get; set; }public Uri LockScreenBadgeLogo { get; set; }Public ReadWrite Property LockScreenBadgeLogo As Uri// You can use this property in JavaScript.
Value
Uri Uri Uri Uri

A Uniform Resource Identifier (URI) that specifies the logo image file location.

See Also

LockScreenDisplayBadgeAndTileText LockScreenDisplayBadgeAndTileText LockScreenDisplayBadgeAndTileText LockScreenDisplayBadgeAndTileText

Gets or sets whether the secondary tile is eligible to display both a badge and a detailed tile on the lock screen. If you set this property to True, you must also provide a badge image through the LockScreenBadgeLogo property. If you do not want to use the detailed tile capability, provide a badge image through the LockScreenBadgeLogo property and set LockScreenDisplayBadgeAndTileText to False.

Note

Stating that your secondary tile is eligible for a lock screen presence does not guarantee that it will have one. Only the user can add an app to one of the seven lock screen slots, as well as choosing which one of them can display detailed tile information. For more information, see the Lock screen overview.

public : PlatForm::Boolean LockScreenDisplayBadgeAndTileText { get; set; }public bool LockScreenDisplayBadgeAndTileText { get; set; }Public ReadWrite Property LockScreenDisplayBadgeAndTileText As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the secondary tile can have a lock screen presence; otherwise, False.

See Also

Logo Logo Logo Logo

Note

Logo may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTileVisualElements.Square150x150Logo.

Gets or sets the logo image used in a medium tile. This property is required when you create either a square or a wide tile.

public : Uri Logo { get; set; }public Uri Logo { get; set; }Public ReadWrite Property Logo As Uri// You can use this property in JavaScript.
Value
Uri Uri Uri Uri

The location of the image. This can be expressed as one of these schemes: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.ms-appdata:///local/A file found in the per-user app storage.

Remarks

A logo image that is saved locally (ms-appdata://localfolder/) by the app to use as a secondary tile default image should not be deleted by the app. This prevents loss of the image if the cache is cleared.

See Also

PhoneticName PhoneticName PhoneticName PhoneticName

Gets or sets a phonetic version of the secondary tile name. Used with character-based languages for UI sorting purposes.

public : PlatForm::String PhoneticName { get; set; }public string PhoneticName { get; set; }Public ReadWrite Property PhoneticName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The phonetic name.

Remarks

In certain character-based languages such as Japanese, the sort order in the UI is based on a phonetic spelling of the characters that make up the app's display name. This phonetic spelling is a separate string from the display name. When a user pins a secondary tile, they can specify a display name for that tile in the pinning flyout but they cannot specify a phonetic spelling. Windows makes a guess as to the phonetic string, but it is not always right.

Apps, however, sometimes know the right phonetic string because the app lets a user define it. In Windows 8.1, an app can then use that information to set this property. Note that this string is tied to the default display name associated with the secondary tile. If the user changes the display name through the pinning flyout, then the system's guess for the phonetic spelling will be used instead.

RoamingEnabled RoamingEnabled RoamingEnabled RoamingEnabled

Gets or sets a value that determines whether the secondary tile will be reacquired through the cloud when the parent app is installed by the user, using their Microsoft account, on another computer. Note that as of Windows 8.1, roaming is the default behavior. This is the opposite of the default Windows 8 behavior, where roaming was opt-in.

This property always returns false on Windows Phone 8.1.

public : PlatForm::Boolean RoamingEnabled { get; set; }public bool RoamingEnabled { get; set; }Public ReadWrite Property RoamingEnabled As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

Set to true if roaming is enabled; otherwise, false. The default is true.

Setting this value in a Windows Phone Store app has no effect, and this property always returns false.

See Also

ShortName ShortName ShortName ShortName

Note

ShortName may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTile.DisplayName.

Gets or sets a short name to display directly on the tile.

Note

As of Windows 8.1, this property is ignored and the display name declared in the manifest is used in its place.

public : PlatForm::String ShortName { get; set; }public string ShortName { get; set; }Public ReadWrite Property ShortName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The short name. Anything over 40 characters will be truncated. The user has the option to change this value as part of the pinning process.

Remarks

This display name is shown on the tile if the ShowName attribute is set through either the tile constructor or the tileOptions property.

This display name is visible to searches.

The user has the option to change this value to a string of their own choosing as part of the pinning process.

See Also

SmallLogo SmallLogo SmallLogo SmallLogo

Note

SmallLogo may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTileVisualElements.Square30x30Logo.

Gets or sets the small logo image, used in search results, the All Programs list, and other locations in the UI.

The small logo is not used with a Windows Phone 8.1 secondary tile.

public : Uri SmallLogo { get; set; }public Uri SmallLogo { get; set; }Public ReadWrite Property SmallLogo As Uri// You can use this property in JavaScript.
Value
Uri Uri Uri Uri

The location of the image. This must be expressed using this scheme: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.

Remarks

If this image is not provided, the small logo of this secondary tile's parent app is used.

A logo image that is saved locally (ms-appdata://localfolder/) by the app to use in a secondary tile should not be deleted by the app. This prevents loss of the image if the cache is cleared.

See Also

TileId TileId TileId TileId

Gets or sets a unique string to identify the tile within the package. This property is required when you create or delete a tile.

public : PlatForm::String TileId { get; set; }public string TileId { get; set; }Public ReadWrite Property TileId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A unique identifier, meaningful to your app. It is limited to 64 characters and must begin with a number or letter and be composed of the characters a-z, A-Z, 0-9, period (.), or underscore (_). It cannot contain spaces, commas, or any of these characters: | > < " / ? * \ ; : ! '

Remarks

If two secondary tiles have the same ID, the last one to be pinned will overwrite the existing tile.

See Also

TileOptions TileOptions TileOptions TileOptions

Note

TileOptions may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTile.VisualElements.

Gets or sets options available to a secondary tile.

public : TileOptions TileOptions { get; set; }public TileOptions TileOptions { get; set; }Public ReadWrite Property TileOptions As TileOptions// You can use this property in JavaScript.
Value
TileOptions TileOptions TileOptions TileOptions

One or more enumeration values. See TileOptions for the full list of valid values.

Remarks

The default value for this property is None.

See Also

VisualElements VisualElements VisualElements VisualElements

Gets an object through which you can get or set a secondary tile's background color, foreground text, tile images, and app name display options. As of Windows 8.1, the properties of this object replace these SecondaryTile properties:

public : SecondaryTileVisualElements VisualElements { get; }public SecondaryTileVisualElements VisualElements { get; }Public ReadOnly Property VisualElements As SecondaryTileVisualElements// You can use this property in JavaScript.

WideLogo WideLogo WideLogo WideLogo

Note

WideLogo may be altered or unavailable for releases after Windows 8.1. Instead, use SecondaryTileVisualElements.Wide310x150Logo.

Gets or sets the logo image used in a wide secondary tile. This property is required when you create a wide secondary tile and gives the user the option of a wide tile when they resize the tile.

public : Uri WideLogo { get; set; }public Uri WideLogo { get; set; }Public ReadWrite Property WideLogo As Uri// You can use this property in JavaScript.
Value
Uri Uri Uri Uri

The location of the image. This can be expressed using one of these schemes: ms-appx:///A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.ms-appdata:///local/A file found in the per-user app storage.

Remarks

A logo image that is saved locally (ms-appdata://localfolder/) by the app to use in a secondary tile should not be deleted by the app. This prevents loss of the image if the cache is cleared.

See Also

Methods

Exists(String) Exists(String) Exists(String) Exists(String)

Checks whether a specific secondary tile exists for the calling app.

public : static PlatForm::Boolean Exists(PlatForm::String tileId)public static bool Exists(String tileId)Public Static Function Exists(tileId As String) As bool// You can use this method in JavaScript.
Parameters
tileId
PlatForm::String String String String

The unique ID string that was assigned to the tile when it was created.

Returns
PlatForm::Boolean bool bool bool

True if the tile exists in the calling application; otherwise, false.

See Also

FindAllAsync() FindAllAsync() FindAllAsync() FindAllAsync()

Retrieves a list of secondary tiles created for the calling app.

public : static IAsyncOperation<IVectorView<SecondaryTile>> FindAllAsync()public static IAsyncOperation<IReadOnlyList<SecondaryTile>> FindAllAsync()Public Static Function FindAllAsync() As IAsyncOperation( Of IReadOnlyListSecondaryTile )// You can use this method in JavaScript.
Returns
IAsyncOperation<IVectorView<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>>

An enumeration object that allows you to examine the set of tiles.

See Also

FindAllAsync(String) FindAllAsync(String) FindAllAsync(String) FindAllAsync(String)

Retrieves a list of secondary tiles created for another app in the same package as the calling app.

public : static IAsyncOperation<IVectorView<SecondaryTile>> FindAllAsync(PlatForm::String applicationId)public static IAsyncOperation<IReadOnlyList<SecondaryTile>> FindAllAsync(String applicationId)Public Static Function FindAllAsync(applicationId As String) As IAsyncOperation( Of IReadOnlyListSecondaryTile )// You can use this method in JavaScript.
Parameters
applicationId
PlatForm::String String String String

The Package Relative Application ID (PRAID) of the app.

Returns
IAsyncOperation<IVectorView<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>>

An enumeration object that allows you to examine the set of tiles.

See Also

FindAllForPackageAsync() FindAllForPackageAsync() FindAllForPackageAsync() FindAllForPackageAsync()

Retrieves a list of secondary tiles created for all of the apps in the package of the calling app.

When an app launches, it should always enumerate its secondary tiles through this method, in case there were any additions or deletions of which it was unaware. When a secondary tile is deleted through the Start screen app bar, Windows simply removes the tile. The app itself is responsible for releasing any resources that were used by the secondary tile. When secondary tiles are copied through the cloud, current tile or badge notifications on the secondary tile, scheduled notifications, push notification channels, and Uniform Resource Identifier (URI) used with periodic notifications are not copied with the secondary tile and must be reset up.

public : static IAsyncOperation<IVectorView<SecondaryTile>> FindAllForPackageAsync()public static IAsyncOperation<IReadOnlyList<SecondaryTile>> FindAllForPackageAsync()Public Static Function FindAllForPackageAsync() As IAsyncOperation( Of IReadOnlyListSecondaryTile )// You can use this method in JavaScript.
Returns
IAsyncOperation<IVectorView<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>>

An enumeration object that allows you to examine the set of tiles.

Remarks

This method returns a collection of tile IDs through an instance of the IAsyncOperation interface. When the asynchronous operation completes successfully, it returns the collection object through a then or done method.

See Also

RequestCreateAsync() RequestCreateAsync() RequestCreateAsync() RequestCreateAsync()

Displays the Pin to Start flyout, through which the user can confirm that they want to create the secondary tile, which in turn creates the tile. Overloads of this method let you specify the on-screen location of the flyout.

Note

It is a best practice to display the Pin to Start flyout near the button that invoked the request to create the tile. Therefore, we recommend that you use the RequestCreateAsync(Point) form of this method overload.

On Windows Phone 8.1, the secondary tile is created through this call without showing the user a flyout, prompting them for confirmation, or allowing them to choose a tile size or title text. Note that when using the RequestCreateAsync method to pin a secondary tile in Windows Phone Store app, the app is suspended and the user is taken to the Start screen. This same API call on a PC does not suspend the program. Therefore, be aware that any code called after RequestCreateAsync is not guaranteed to be run before the app is suspended. To avoid this potential issue you should use the OnSuspended event of your app to run any code, such as updating the pinned tile, that should be run before the app suspends. To see an example of this pattern, download and run the Tile update on suspend sample.

public : IAsyncOperation<PlatForm::Boolean> RequestCreateAsync()public IAsyncOperation<bool> RequestCreateAsync()Public Function RequestCreateAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

An object used to launch the asynchronous create operation as well as to retrieve information about it.

Examples

The following example creates and pins a previously defined SecondaryTile object "tile" to the Start screen.


tile.requestCreateAsync().then(function (isCreated) {
    if (isCreated) {
        // Secondary tile successfully pinned.
    } else {
        // Secondary tile not pinned.
    }
});

Remarks

After a secondary tile is created, you must provide the following properties before it is displayed:

This method returns an asynchronous Boolean value through its IAsyncOperation object as shown here. A value of true indicates that the secondary tile was created and pinned to the Start screen.

secondaryTile.requestCreateAsync().then( function (isPinned) { } );
async void showTileCreateRequest( SecondaryTile tile )  
{      
    bool isPinned = await tile.requestCreateAsync();  
}
See Also

RequestCreateAsync(Point) RequestCreateAsync(Point) RequestCreateAsync(Point) RequestCreateAsync(Point)

Displays the Pin to Start flyout above a specified location, through which the user can confirm that they want to create the secondary tile, which in turn creates the tile.

On Windows Phone 8.1, the secondary tile is created through this call without showing the user a flyout, prompting them for confirmation, or allowing them to choose a tile size or title text. Note that when using the RequestCreateAsync method to pin a secondary tile in Windows Phone Store app, the app is suspended and the user is taken to the Start screen. This same API call on a PC does not suspend the program. Therefore, be aware that any code called after RequestCreateAsync is not guaranteed to be run before the app is suspended. To avoid this potential issue you should use the OnSuspended event of your app to run any code, such as updating the pinned tile, that should be run before the app suspends. To see an example of this pattern, download and run the Tile update on suspend sample.

public : IAsyncOperation<PlatForm::Boolean> RequestCreateAsync(Point invocationPoint)public IAsyncOperation<bool> RequestCreateAsync(Point invocationPoint)Public Function RequestCreateAsync(invocationPoint As Point) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
invocationPoint
Point Point Point Point

The point used as the lower-right corner of the Pin to Start flyout.

Returns

An object that provides information concerning the asynchronous create operation.

See Also

RequestCreateForSelectionAsync(Rect) RequestCreateForSelectionAsync(Rect) RequestCreateForSelectionAsync(Rect) RequestCreateForSelectionAsync(Rect)

Displays the Pin to Start flyout above a specified area. This flyout is used by the user to confirm that they want to create the secondary tile, which in turn creates the tile.

On Windows Phone 8.1, the secondary tile is created through this call without showing the user a flyout, prompting them for confirmation, or allowing them to choose a tile size or title text. Note that when using the RequestCreateAsync method to pin a secondary tile in Windows Phone Store app, the app is suspended and the user is taken to the Start screen. This same API call on a PC does not suspend the program. Therefore, be aware that any code called after RequestCreateAsync is not guaranteed to be run before the app is suspended. To avoid this potential issue you should use the OnSuspended event of your app to run any code, such as updating the pinned tile, that should be run before the app suspends. To see an example of this pattern, download and run the Tile update on suspend sample.

public : IAsyncOperation<PlatForm::Boolean> RequestCreateForSelectionAsync(Rect selection)public IAsyncOperation<bool> RequestCreateForSelectionAsync(Rect selection)Public Function RequestCreateForSelectionAsync(selection As Rect) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
selection
Rect Rect Rect Rect

The area that the flyout is displayed directly above.

Returns

An object that provides information concerning the asynchronous create operation.

Remarks

After a secondary tile is created, you must provide the following properties before it is displayed:

See Also

RequestCreateForSelectionAsync(Rect, Placement) RequestCreateForSelectionAsync(Rect, Placement) RequestCreateForSelectionAsync(Rect, Placement) RequestCreateForSelectionAsync(Rect, Placement)

Displays the Pin to Start flyout at the specified side of a specified area. This flyout is used by the user to confirm that they want to create the secondary tile, which in turn creates the tile.

On Windows Phone 8.1, the secondary tile is created through this call without showing the user a flyout, prompting them for confirmation, or allowing them to choose a tile size or title text. Note that when using the RequestCreateAsync method to pin a secondary tile in Windows Phone Store app, the app is suspended and the user is taken to the Start screen. This same API call on a PC does not suspend the program. Therefore, be aware that any code called after RequestCreateAsync is not guaranteed to be run before the app is suspended. To avoid this potential issue you should use the OnSuspended event of your app to run any code, such as updating the pinned tile, that should be run before the app suspends. To see an example of this pattern, download and run the Tile update on suspend sample.

public : IAsyncOperation<PlatForm::Boolean> RequestCreateForSelectionAsync(Rect selection, Placement preferredPlacement)public IAsyncOperation<bool> RequestCreateForSelectionAsync(Rect selection, Placement preferredPlacement)Public Function RequestCreateForSelectionAsync(selection As Rect, preferredPlacement As Placement) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
selection
Rect Rect Rect Rect

The area to one side of which the flyout will be displayed.

preferredPlacement
Placement Placement Placement Placement

The side of the rectangle where the flyout should appear.

Returns

An object that provides information concerning the asynchronous create operation.

See Also

RequestDeleteAsync() RequestDeleteAsync() RequestDeleteAsync() RequestDeleteAsync()

Displays the Unpin from Start flyout. This flyout lets the user confirm removal of the secondary tile.

public : IAsyncOperation<PlatForm::Boolean> RequestDeleteAsync()public IAsyncOperation<bool> RequestDeleteAsync()Public Function RequestDeleteAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

An object that provides information concerning the asynchronous delete operation.

Examples

The following example demonstrates how to delete (unpin) a secondary tile. Note that this example assumes that the tile exists. To determine whether the tile is pinned before you call RequestDeleteAsync, see the Exists method.


// Specify the tile to be deleted, using the ID that it was given when it was originally created.
var tileToBeDeleted = new Windows.UI.StartScreen.SecondaryTile("SecondaryTile.01");

// Make the delete request.
tileToBeDeleted.requestDeleteAsync().then(function (isDeleted) {
    if (isDeleted) {
        // Secondary tile successfully deleted.
    } else {
        // Secondary tile not deleted.
    }
});
See Also

RequestDeleteAsync(Point) RequestDeleteAsync(Point) RequestDeleteAsync(Point) RequestDeleteAsync(Point)

Displays the Unpin from Start flyout at a specified point. This flyout lets the user confirm removal of the secondary tile.

public : IAsyncOperation<PlatForm::Boolean> RequestDeleteAsync(Point invocationPoint)public IAsyncOperation<bool> RequestDeleteAsync(Point invocationPoint)Public Function RequestDeleteAsync(invocationPoint As Point) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
invocationPoint
Point Point Point Point

The point used as the lower-right corner of the Pin to Start flyout.

Returns

An object that provides information concerning the asynchronous delete operation.

Remarks

The only property that must be set on the tile before calling this method is tileId. If tileId is not set, the call to this method raises an exception.

This method returns an asynchronous Boolean value through its IAsyncOperation.getResults method as shown here.


[JavaScript]  
oSecondaryTile.requestCreateAsync( { x:100, y:100 } ).then( function (isDeleted) { } );      

[C#]  
void async showTileCreateRequest( SecondaryTile tile, Point pt)  
{      
    bool isDeleted = await tile.requestCreateAsync( pt );  
}
See Also

RequestDeleteForSelectionAsync(Rect) RequestDeleteForSelectionAsync(Rect) RequestDeleteForSelectionAsync(Rect) RequestDeleteForSelectionAsync(Rect)

Displays the Unpin from Start flyout above a specified area. This flyout lets the user confirm removal of the secondary tile.

public : IAsyncOperation<PlatForm::Boolean> RequestDeleteForSelectionAsync(Rect selection)public IAsyncOperation<bool> RequestDeleteForSelectionAsync(Rect selection)Public Function RequestDeleteForSelectionAsync(selection As Rect) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
selection
Rect Rect Rect Rect

The area that the secondary tile is displayed directly above.

Returns

An object that provides information concerning the asynchronous delete operation.

Remarks

The only property that must be set on the tile before calling this method is tileId. If tileId is not set, the call to this method raises an exception.

See Also

RequestDeleteForSelectionAsync(Rect, Placement) RequestDeleteForSelectionAsync(Rect, Placement) RequestDeleteForSelectionAsync(Rect, Placement) RequestDeleteForSelectionAsync(Rect, Placement)

Displays the Unpin from Start flyout at the specified side of a specified area. This flyout lets the user confirm removal of the secondary tile.

public : IAsyncOperation<PlatForm::Boolean> RequestDeleteForSelectionAsync(Rect selection, Placement preferredPlacement)public IAsyncOperation<bool> RequestDeleteForSelectionAsync(Rect selection, Placement preferredPlacement)Public Function RequestDeleteForSelectionAsync(selection As Rect, preferredPlacement As Placement) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
selection
Rect Rect Rect Rect

The area to the side of which the flyout will be displayed.

preferredPlacement
Placement Placement Placement Placement

One of the enumeration values that specifies the side of the rectangle where the flyout should be shown.

Returns

An object that provides information concerning the asynchronous delete operation.

See Also

UpdateAsync() UpdateAsync() UpdateAsync() UpdateAsync()

Updates a secondary tile after that tile is pinned to the Start screen.

On Windows Phone 8.1, your app is suspended and the user is taken to the Start screen when a secondary tile is pinned. Therefore, be aware that any code called after RequestCreateAsync is not guaranteed to be run before the app is suspended. To avoid this potential issue you should use the OnSuspended event of your app to run any code, such as updating the pinned tile, that should be run before the app suspends. To see an example of this pattern, download and run the Tile update on suspend sample.

public : IAsyncOperation<PlatForm::Boolean> UpdateAsync()public IAsyncOperation<bool> UpdateAsync()Public Function UpdateAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

An object used to launch the asynchronous create operation as well as to retrieve information about it.

Remarks

This method updates the following properties of the secondary tile:

On Windows 8 and Windows 8.1, this method doesn't update these properties:

If the TileId property is not set before you call this method, the call will raise an exception.

See Also

Events

VisualElementsRequested VisualElementsRequested VisualElementsRequested VisualElementsRequested

Fired when a call is made to RequestCreateAsync.

This event is not raised on Windows Phone 8.1.

public : event TypedEventHandler VisualElementsRequested<SecondaryTile,  VisualElementsRequestedEventArgs>public event TypedEventHandler VisualElementsRequested<SecondaryTile,  VisualElementsRequestedEventArgs>Public Event VisualElementsRequested<SecondaryTile,  VisualElementsRequestedEventArgs>// You can use this event in JavaScript.

Remarks

This event is not raised for Windows Phone Store app.

See Also

See Also