Dela via


SecondaryTile.RequestCreateAsync Method

Definition

Overloads

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.

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.

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:
 virtual IAsyncOperation<bool> ^ RequestCreateAsync() = RequestCreateAsync;
/// [Windows.Foundation.Metadata.Overload("RequestCreateAsync")]
IAsyncOperation<bool> RequestCreateAsync();
[Windows.Foundation.Metadata.Overload("RequestCreateAsync")]
public IAsyncOperation<bool> RequestCreateAsync();
function requestCreateAsync()
Public Function RequestCreateAsync () As IAsyncOperation(Of Boolean)

Returns

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

Attributes

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.

async void showTileCreateRequest( SecondaryTile tile )  
{
    bool isPinned = await tile.requestCreateAsync();  
}

Applies to

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:
 virtual IAsyncOperation<bool> ^ RequestCreateAsync(Point invocationPoint) = RequestCreateAsync;
/// [Windows.Foundation.Metadata.Overload("RequestCreateAsyncWithPoint")]
IAsyncOperation<bool> RequestCreateAsync(Point const& invocationPoint);
[Windows.Foundation.Metadata.Overload("RequestCreateAsyncWithPoint")]
public IAsyncOperation<bool> RequestCreateAsync(Point invocationPoint);
function requestCreateAsync(invocationPoint)
Public Function RequestCreateAsync (invocationPoint As Point) As IAsyncOperation(Of Boolean)

Parameters

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

Attributes

Applies to