QuickLink class

2 out of 3 rated this helpful - Rate this topic

Represents shortcuts that help users share content with the apps they use most.

Syntax


var quickLink = new Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink();

Attributes

ActivatableAttribute(NTDDI_WIN8)
MarshalingBehaviorAttribute(Standard)
VersionAttribute(NTDDI_WIN8)

Members

The QuickLink class has these types of members:

Constructors

The QuickLink class has these constructors.

ConstructorDescription
QuickLink Creates a new instance of a QuickLink object.

 

Methods

The QuickLink class inherits methods from the Object class (C#/VB/C++).

Properties

The QuickLink class has these properties.

PropertyAccess typeDescription

Id

Read/writeSpecifies an ID for the QuickLink. Your app receives this ID when the user selects its QuickLink. You can use this ID to further customize the sharing process for the user.

SupportedDataFormats

Read-onlyAn array of strings that specify the data formats supported by the QuickLink app. The system shows the QuickLink only when the data that a user wants to share matches a format in this array.

SupportedFileTypes

Read-onlyAn array of strings that specify the file types supported by a QuickLink app. The system shows the QuickLink only when the data that a user wants to share contains file items, and the file extensions for those file items match a file type in this array.

Thumbnail

Read/writeSpecifies a thumbnail image for the QuickLink. The system displays this image when the user is presented with a list of possible apps to share content with.

Title

Read/writeSpecifies the title of a QuickLink. The system displays this info when the user is presented with a list of possible apps to share content with.

 

Remarks

Note  : This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Examples

The following function creates and returns a QuickLink.


function reportCompleted() {
    var quickLink = new Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink();
    quickLink.id = "123456789";
    quickLink.title = id("quickLinkTitle").value;
    
    // For quicklinks, the supported FileTypes and DataFormats are set 
    // independently from the manifest.
    var dataFormats = Windows.ApplicationModel.DataTransfer.StandardDataFormats;
    quickLink.supportedFileTypes.replaceAll(["*"]);
    quickLink.supportedDataFormats.replaceAll([dataFormats.text, dataFormats.uri, 
        dataFormats.bitmap, dataFormats.storageItems, dataFormats.html, customFormatName]);

    Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("images\\user.png").then(function (iconFile) {
        quickLink.thumbnail = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(iconFile);
        shareOperation.reportCompleted(quickLink);
    });
    shareOperation.reportCompleted(quickLink);
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

Windows.ApplicationModel.DataTransfer.ShareTarget
Windows::ApplicationModel::DataTransfer::ShareTarget [C++]

Metadata

Windows.winmd

 

 

Build date: 12/4/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.