SecondaryTile SecondaryTile SecondaryTile SecondaryTile SecondaryTile Class

Definition

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

public : sealed class SecondaryTile : ISecondaryTile, ISecondaryTile2
struct winrt::Windows::UI::StartScreen::SecondaryTile : ISecondaryTile, ISecondaryTile2
public sealed class SecondaryTile : ISecondaryTile, ISecondaryTile2
Public NotInheritable Class SecondaryTile Implements ISecondaryTile, ISecondaryTile2
var secondaryTile = new secondaryTile();
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.

using Windows.UI.StartScreen;

// Prepare package images for all four tile sizes in our tile to be pinned as well as for the square30x30 logo used in the Apps view.  
Uri square150x150Logo = new Uri("ms-appx:///Assets/square150x150Tile-sdk.png");
Uri wide310x150Logo = new Uri("ms-appx:///Assets/wide310x150Tile-sdk.png");
Uri square310x310Logo = new Uri("ms-appx:///Assets/square310x310Tile-sdk.png"); 
Uri square30x30Logo = new Uri("ms-appx:///Assets/square30x30Tile-sdk.png");

// During creation of secondary tile, an application may set additional arguments on the tile that will be passed in during activation.
// These arguments should be meaningful to the application. In this sample, we'll pass in the date and time the secondary tile was pinned.
string tileActivationArguments = MainPage.logoSecondaryTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString();

// Create a Secondary tile with all the required arguments.
// Note the last argument specifies what size the Secondary tile should show up as by default in the Pin to start fly out.
// It can be set to TileSize.Square150x150, TileSize.Wide310x150, or TileSize.Default.  
// If set to TileSize.Wide310x150, then the asset for the wide size must be supplied as well.
// TileSize.Default will default to the wide size if a wide size is provided, and to the medium size otherwise. 
SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId,
                                                "Title text shown on the tile",
                                                tileActivationArguments,
                                                square150x150Logo,
                                                TileSize.Square150x150);

// Pin the tile
bool isPinned = await tile.RequestCreateAsync();
if (isPinned) {
    // Secondary tile successfully pinned.
} 
else {
    // Secondary tile not pinned.
}

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

// Check if the secondary tile is pinned
if (SecondaryTile.Exists(tileId)) {
    // Initialize a secondary tile with the same tile ID you want removed
    SecondaryTile toBeDeleted = new SecondaryTile(tileId);

    // And then unpin the tile
    bool isDeleted = await toBeDeleted.RequestDeleteAsync();
    if (isDeleted) {
        // Secondary tile successfully deleted.
    } else {
        // Secondary tile not deleted.
    }
}

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

// Get all secondary tiles
var tiles = await SecondaryTile.FindAllAsync();

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.

using NotificationsExtensions.TileContent;

// Define the notification context.
// Note: This sample contains an additional reference, NotificationsExtensions, which you can use in your apps
ITileWide310x150Text04 tileContent = TileContentFactory.CreateTileWide310x150Text04();
tileContent.TextBodyWrap.Text = "Sent to a secondary tile from NotificationsExtensions!";

// Provide a square version of the notification.
ITileSquare150x150Text04 squareContent = TileContentFactory.CreateTileSquare150x150Text04();
squareContent.TextBodyWrap.Text = "Sent to a secondary tile from NotificationExtensions!";
tileContent.Square150x150Content = squareContent;

// Send the notification to the secondary tile by creating a secondary tile updater
TileUpdateManager.CreateTileUpdaterForSecondaryTile(MainPage.dynamicTileId).Update(tileContent.CreateNotification());

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

using NotificationsExtensions.BadgeContent;

// Define the badge content
BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(6);

// Send the notification to the secondary tile
BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(MainPage.dynamicTileId).Update(badgeContent.CreateNotification());

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

Creates a SecondaryTile object. The caller must then set any mandatory properties through the object before attempting to pin, update, or delete the tile.

public : SecondaryTile()
SecondaryTile() const;
public SecondaryTile()
Public Sub New()
var secondaryTile = new secondaryTile();

Remarks

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.

SecondaryTile(String) 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)
SecondaryTile(winrt::hstring tileId) const;
public SecondaryTile(String tileId)
Public Sub New(tileId As String)
var secondaryTile = new secondaryTile(tileId);
Parameters
tileId
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.

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) 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)
SecondaryTile(winrt::hstring tileId, winrt::hstring shortName, winrt::hstring displayName, winrt::hstring arguments, TileOptions tileOptions, Uri logoReference) const;
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)
var secondaryTile = new secondaryTile(tileId, shortName, displayName, arguments, tileOptions, logoReference);
Parameters
tileId
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
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
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
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

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

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.

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) 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)
SecondaryTile(winrt::hstring tileId, winrt::hstring shortName, winrt::hstring displayName, winrt::hstring arguments, TileOptions tileOptions, Uri logoReference, Uri wideLogoReference) const;
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)
var secondaryTile = new secondaryTile(tileId, shortName, displayName, arguments, tileOptions, logoReference, wideLogoReference);
Parameters
tileId
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
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
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
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

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

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

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.

SecondaryTile(String, String, String, Uri, TileSize) 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)
SecondaryTile(winrt::hstring tileId, winrt::hstring displayName, winrt::hstring arguments, Uri square150x150Logo, TileSize desiredSize) const;
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)
var secondaryTile = new secondaryTile(tileId, displayName, arguments, square150x150Logo, desiredSize);
Parameters
tileId
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
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
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

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

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

Properties

Arguments 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; }
winrt::hstring Arguments(); void Arguments(winrt::hstring arguments);
public string Arguments { get; set; }
Public ReadWrite Property Arguments As string
var string = secondaryTile.arguments;
secondaryTile.arguments = string;
Value
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.

BackgroundColor 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; }
Color BackgroundColor(); void BackgroundColor(Color backgroundcolor);
public Color BackgroundColor { get; set; }
Public ReadWrite Property BackgroundColor As Color
var color = secondaryTile.backgroundColor;
secondaryTile.backgroundColor = color;
Value
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.

DisplayName 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; }
winrt::hstring DisplayName(); void DisplayName(winrt::hstring displayname);
public string DisplayName { get; set; }
Public ReadWrite Property DisplayName As string
var string = secondaryTile.displayName;
secondaryTile.displayName = string;
Value
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.

ForegroundText 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; }
ForegroundText ForegroundText(); void ForegroundText(ForegroundText foregroundtext);
public ForegroundText ForegroundText { get; set; }
Public ReadWrite Property ForegroundText As ForegroundText
var foregroundText = secondaryTile.foregroundText;
secondaryTile.foregroundText = foregroundText;
Value
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.

LockScreenBadgeLogo 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; }
Uri LockScreenBadgeLogo(); void LockScreenBadgeLogo(Uri lockscreenbadgelogo);
public Uri LockScreenBadgeLogo { get; set; }
Public ReadWrite Property LockScreenBadgeLogo As Uri
var uri = secondaryTile.lockScreenBadgeLogo;
secondaryTile.lockScreenBadgeLogo = uri;
Value
Uri Uri Uri

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

LockScreenDisplayBadgeAndTileText 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; }
bool LockScreenDisplayBadgeAndTileText(); void LockScreenDisplayBadgeAndTileText(bool lockscreendisplaybadgeandtiletext);
public bool LockScreenDisplayBadgeAndTileText { get; set; }
Public ReadWrite Property LockScreenDisplayBadgeAndTileText As bool
var bool = secondaryTile.lockScreenDisplayBadgeAndTileText;
secondaryTile.lockScreenDisplayBadgeAndTileText = bool;
Value
bool bool bool

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

Logo 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; }
Uri Logo(); void Logo(Uri logo);
public Uri Logo { get; set; }
Public ReadWrite Property Logo As Uri
var uri = secondaryTile.logo;
secondaryTile.logo = uri;
Value
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.

PhoneticName 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; }
winrt::hstring PhoneticName(); void PhoneticName(winrt::hstring phoneticname);
public string PhoneticName { get; set; }
Public ReadWrite Property PhoneticName As string
var string = secondaryTile.phoneticName;
secondaryTile.phoneticName = string;
Value
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 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; }
bool RoamingEnabled(); void RoamingEnabled(bool roamingenabled);
public bool RoamingEnabled { get; set; }
Public ReadWrite Property RoamingEnabled As bool
var bool = secondaryTile.roamingEnabled;
secondaryTile.roamingEnabled = bool;
Value
bool bool bool

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

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

ShortName 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; }
winrt::hstring ShortName(); void ShortName(winrt::hstring shortname);
public string ShortName { get; set; }
Public ReadWrite Property ShortName As string
var string = secondaryTile.shortName;
secondaryTile.shortName = string;
Value
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.

SmallLogo 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; }
Uri SmallLogo(); void SmallLogo(Uri smalllogo);
public Uri SmallLogo { get; set; }
Public ReadWrite Property SmallLogo As Uri
var uri = secondaryTile.smallLogo;
secondaryTile.smallLogo = uri;
Value
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.

TileId 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; }
winrt::hstring TileId(); void TileId(winrt::hstring tileid);
public string TileId { get; set; }
Public ReadWrite Property TileId As string
var string = secondaryTile.tileId;
secondaryTile.tileId = string;
Value
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.

TileOptions 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; }
TileOptions TileOptions(); void TileOptions(TileOptions tileoptions);
public TileOptions TileOptions { get; set; }
Public ReadWrite Property TileOptions As TileOptions
var tileOptions = secondaryTile.tileOptions;
secondaryTile.tileOptions = tileOptions;
Value
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.

VisualElements 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; }
SecondaryTileVisualElements VisualElements();
public SecondaryTileVisualElements VisualElements { get; }
Public ReadOnly Property VisualElements As SecondaryTileVisualElements
var secondaryTileVisualElements = secondaryTile.visualElements;
Value
SecondaryTileVisualElements SecondaryTileVisualElements SecondaryTileVisualElements

An object that represents the secondary tile.

WideLogo 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; }
Uri WideLogo(); void WideLogo(Uri widelogo);
public Uri WideLogo { get; set; }
Public ReadWrite Property WideLogo As Uri
var uri = secondaryTile.wideLogo;
secondaryTile.wideLogo = uri;
Value
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.

Methods

Exists(String) 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)
bool Exists(winrt::hstring tileId) const;
public static bool Exists(String tileId)
Public Static Function Exists(tileId As String) As bool
var bool = Windows.UI.StartScreen.SecondaryTile.exists(tileId);
Parameters
tileId
String String String

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

Returns
bool bool bool

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

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

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

public : static IAsyncOperation<IVectorView<SecondaryTile>> FindAllAsync()
IAsyncOperation<IVectorView<SecondaryTile>> FindAllAsync() const;
public static IAsyncOperation<IReadOnlyList<SecondaryTile>> FindAllAsync()
Public Static Function FindAllAsync() As IAsyncOperation<IReadOnlyList<SecondaryTile>>( Of IVectorView )
Windows.UI.StartScreen.SecondaryTile.findAllAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>> IAsyncOperation<IReadOnlyList<SecondaryTile>>

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

FindAllAsync(String) 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)
IAsyncOperation<IVectorView<SecondaryTile>> FindAllAsync(winrt::hstring applicationId) const;
public static IAsyncOperation<IReadOnlyList<SecondaryTile>> FindAllAsync(String applicationId)
Public Static Function FindAllAsync(applicationId As String) As IAsyncOperation<IReadOnlyList<SecondaryTile>>( Of IVectorView )
Windows.UI.StartScreen.SecondaryTile.findAllAsync(applicationId).done( /* Your success and error handlers */ );
Parameters
applicationId
String String String

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

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

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

FindAllForPackageAsync() 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()
IAsyncOperation<IVectorView<SecondaryTile>> FindAllForPackageAsync() const;
public static IAsyncOperation<IReadOnlyList<SecondaryTile>> FindAllForPackageAsync()
Public Static Function FindAllForPackageAsync() As IAsyncOperation<IReadOnlyList<SecondaryTile>>( Of IVectorView )
Windows.UI.StartScreen.SecondaryTile.findAllForPackageAsync().done( /* Your success and error handlers */ );
Returns
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.

RequestCreateAsync() 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 8.x 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()
IAsyncOperation<bool> RequestCreateAsync() const;
public IAsyncOperation<bool> RequestCreateAsync()
Public Function RequestCreateAsync() As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestCreateAsync().done( /* Your success and error handlers */ );
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();  
}

RequestCreateAsync(Point) 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 8.x 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)
IAsyncOperation<bool> RequestCreateAsync(Point invocationPoint) const;
public IAsyncOperation<bool> RequestCreateAsync(Point invocationPoint)
Public Function RequestCreateAsync(invocationPoint As Point) As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestCreateAsync(invocationPoint).done( /* Your success and error handlers */ );
Parameters
invocationPoint
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.

RequestCreateForSelectionAsync(Rect) 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 8.x 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)
IAsyncOperation<bool> RequestCreateForSelectionAsync(Rect selection) const;
public IAsyncOperation<bool> RequestCreateForSelectionAsync(Rect selection)
Public Function RequestCreateForSelectionAsync(selection As Rect) As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestCreateForSelectionAsync(selection).done( /* Your success and error handlers */ );
Parameters
selection
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:

RequestCreateForSelectionAsync(Rect, Placement) 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 8.x 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)
IAsyncOperation<bool> RequestCreateForSelectionAsync(Rect selection, Placement preferredPlacement) const;
public IAsyncOperation<bool> RequestCreateForSelectionAsync(Rect selection, Placement preferredPlacement)
Public Function RequestCreateForSelectionAsync(selection As Rect, preferredPlacement As Placement) As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestCreateForSelectionAsync(selection, preferredPlacement).done( /* Your success and error handlers */ );
Parameters
selection
Rect Rect Rect

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

preferredPlacement
Placement Placement Placement

The side of the rectangle where the flyout should appear.

Returns

An object that provides information concerning the asynchronous create operation.

RequestDeleteAsync() 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()
IAsyncOperation<bool> RequestDeleteAsync() const;
public IAsyncOperation<bool> RequestDeleteAsync()
Public Function RequestDeleteAsync() As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestDeleteAsync().done( /* Your success and error handlers */ );
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.
    }
});

RequestDeleteAsync(Point) 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)
IAsyncOperation<bool> RequestDeleteAsync(Point invocationPoint) const;
public IAsyncOperation<bool> RequestDeleteAsync(Point invocationPoint)
Public Function RequestDeleteAsync(invocationPoint As Point) As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestDeleteAsync(invocationPoint).done( /* Your success and error handlers */ );
Parameters
invocationPoint
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 );  
}

RequestDeleteForSelectionAsync(Rect) 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)
IAsyncOperation<bool> RequestDeleteForSelectionAsync(Rect selection) const;
public IAsyncOperation<bool> RequestDeleteForSelectionAsync(Rect selection)
Public Function RequestDeleteForSelectionAsync(selection As Rect) As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestDeleteForSelectionAsync(selection).done( /* Your success and error handlers */ );
Parameters
selection
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.

RequestDeleteForSelectionAsync(Rect, Placement) 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)
IAsyncOperation<bool> RequestDeleteForSelectionAsync(Rect selection, Placement preferredPlacement) const;
public IAsyncOperation<bool> RequestDeleteForSelectionAsync(Rect selection, Placement preferredPlacement)
Public Function RequestDeleteForSelectionAsync(selection As Rect, preferredPlacement As Placement) As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.requestDeleteForSelectionAsync(selection, preferredPlacement).done( /* Your success and error handlers */ );
Parameters
selection
Rect Rect Rect

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

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

UpdateAsync() 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()
IAsyncOperation<bool> UpdateAsync() const;
public IAsyncOperation<bool> UpdateAsync()
Public Function UpdateAsync() As IAsyncOperation( Of bool )
Windows.UI.StartScreen.SecondaryTile.updateAsync().done( /* Your success and error handlers */ );
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.

Events

VisualElementsRequested 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>
// Register
event_token VisualElementsRequested(TypedEventHandler<SecondaryTile, VisualElementsRequestedEventArgs> const& handler) const;

// Revoke with event_token
void VisualElementsRequested(event_token const& cookie) const;

// Revoke with event_revoker
VisualElementsRequested_revoker VisualElementsRequested(auto_revoker_t, TypedEventHandler<SecondaryTile, VisualElementsRequestedEventArgs> const& handler) const;
public event TypedEventHandler VisualElementsRequested<SecondaryTile, VisualElementsRequestedEventArgs>
Public Event TypedEventHandler VisualElementsRequested( Of ( Of SecondaryTile ), ( Of VisualElementsRequestedEventArgs ))
function onVisualElementsRequested(eventArgs){/* Your code */}


secondaryTile.addEventListener("visualElementsRequested", onVisualElementsRequested);
secondaryTile.removeEventListener("visualElementsRequested", onVisualElementsRequested);

Remarks

This event is not raised for Windows Phone 8.x app.

See Also