Data​Package​Property​Set​View Data​Package​Property​Set​View Data​Package​Property​Set​View Data​Package​Property​Set​View Class

Definition

Gets the set of properties of a DataPackageView object.

public : sealed class DataPackagePropertySetView : IDataPackagePropertySetView, IDataPackagePropertySetView2, IDataPackagePropertySetView3, IIterable, IMapViewpublic sealed class DataPackagePropertySetView : IDataPackagePropertySetView, IDataPackagePropertySetView2, IDataPackagePropertySetView3, IEnumerable, IReadOnlyDictionaryPublic NotInheritable Class DataPackagePropertySetView Implements IDataPackagePropertySetView, IDataPackagePropertySetView2, IDataPackagePropertySetView3, IEnumerable, IReadOnlyDictionary// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.text)) {
    var title = shareOperation.data.properties.title;
    var description = shareOperation.data.properties.description;
}

Remarks

In addition to the content being shared, each instance of a DataPackageView object supports a set of properties. Target apps can use these properties to learn more about the content of the DataPackageView.

This class directly supports several default properties, such as a thumbnail, a title, and a description. Target apps can access specific properties through the Lookup or TryGetValue methods.

When a share target receives shared content, it also receives certain properties associated with the source app as a part of the DataPackageView. In Windows Runtime app, several of these properties, such as ApplicationListingUri, ApplicationName, and PackageFamilyName, will be set by the operating system. In Windows Phone Silverlight apps, however, these properties will not be automatically filled and must be set manually.

Collection member lists

For JavaScript, DataPackagePropertySetView supports using an index to access items.

Properties

ApplicationListingUri ApplicationListingUri ApplicationListingUri ApplicationListingUri

Gets the Uniform Resource Identifier (URI) of the app's location in the Windows Store.

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

The Uniform Resource Identifier (URI) of the app in the Windows Store.

ApplicationName ApplicationName ApplicationName ApplicationName

Gets the name of the app that created the DataPackage object.

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

The name of the app that created the DataPackage object.

ContentSourceApplicationLink ContentSourceApplicationLink ContentSourceApplicationLink ContentSourceApplicationLink

Gets the application link to the content from the source app.

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

The Uniform Resource Identifier (URI) of the application link to shared content.

Remarks

ContentSourceApplicationLink is a companion property that you use to attribute shared content. It's shared when the app finds it meaningful for the user to return to the content that's currently displayed in the app. When the user makes a selection, the ApplicationLink format isn't populated, because the value for ApplicationLink format isn't the same as the user's selection. Populating this info doesn't mean that the deep link into the app represents the user's selection, only that the content comes from there.

ContentSourceWebLink ContentSourceWebLink ContentSourceWebLink ContentSourceWebLink

Gets a web link to shared content that's currently displayed in the app.

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

The Uniform Resource Identifier (URI) of the web link to shared content.

Remarks

ContentSourceWebLink is a companion property that you use to attribute shared content. It's shared when the app provides a web link to the content being shared. When the user makes an explicit selection, the WebLink format isn't populated, because the value for the WebLink format isn't the same as the user's selection. Populating this info doesn't mean that the web page is the user's selection, only that the content comes from there.

Description Description Description Description

Gets the text that describes the contents of the DataPackage.

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

Text that describes the contents of the DataPackage.

EnterpriseId EnterpriseId EnterpriseId EnterpriseId

Gets or sets the enterprise Id.

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

The enterprise Id.

FileTypes FileTypes FileTypes FileTypes

Gets a vector object that contains the types of files stored in the DataPackage object.

public : IVectorView<string> FileTypes { get; }public IReadOnlyList<string> FileTypes { get; }Public ReadOnly Property FileTypes As IReadOnlyList<string>// You can use this property in JavaScript.
Value
IVectorView<PlatForm::String> IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

Contains the types of files stored in the DataPackage object.

Item[TKey] Item[TKey] Item[TKey] Item[TKey]

Gets the element that has the specified key in the read-only dictionary.

This member is not implemented in C++TValue this[TKey key] { get; }ReadOnly Property Item(key As TKey) As TValueTValue this[TKey key] { get; }
Parameters
key
TKey TKey TKey TKey

The key to locate.

Value
TValue TValue TValue TValue

The element that has the specified key in the read-only dictionary.

Exceptions

key is null.

The property is retrieved and key is not found.

Keys Keys Keys Keys

Gets an enumerable collection that contains the keys in the read-only dictionary.

This member is not implemented in C++IEnumerable<TKey> Keys { get; }ReadOnly Property Keys As IEnumerable(Of TKey)IEnumerable<TKey> Keys { get; }
Value

An enumerable collection that contains the keys in the read-only dictionary.

LogoBackgroundColor LogoBackgroundColor LogoBackgroundColor LogoBackgroundColor

Gets a background color for the sharing app's Square30x30Logo.

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

The background color for the sharing app's Square30x30Logo.

PackageFamilyName PackageFamilyName PackageFamilyName PackageFamilyName

Gets the package family name of the source app.

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

The package family name.

Size Size Size Size

Gets the number of items that are contained in the property set.

public : unsigned short Size { get; }This member is not implemented in C#This member is not implemented in VB.Net// You can use this property in JavaScript.
Value
unsigned short uint uint uint

The number of elements in the property set.

Remarks

For more info, see IMapView(String, Object).

Square30x30Logo Square30x30Logo Square30x30Logo Square30x30Logo

Gets the source app's logo.

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

Remarks

The logo is padded with the color in LogoBackgroundColor.

Thumbnail Thumbnail Thumbnail Thumbnail

Gets the thumbnail image for the DataPackageView.

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

Examples

This example shows how you can get a thumbnail image from a DataPackageView.

if (shareOperation.data.properties.thumbnail) {
    shareOperation.data.properties.thumbnail.openReadAsync().then(function (thumbnailStream) {
        var thumbnailBlob = MSApp.createBlobFromRandomAccessStream(thumbnailStream.contentType, thumbnailStream);
        var thumbnailUrl = URL.createObjectURL(thumbnailBlob, false);
        // To display the thumbnail, you need an element with id of "thumbnail"
        // in your HTML page.
        document.getElementById("thumbnail").src = thumbnailUrl;
    });
}

Remarks

We recommend that any time you get a DataPackageView that contains an image, you also check for thumbnail image. Doing so gives allows your app to display a visual representation of the images being shared to the user while the share operation completes.

Title Title Title Title

Gets the text that displays as a title for the contents of the DataPackagePropertySetView object.

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

The text that displays as a title for the contents of the DataPackagePropertySetView object.

Remarks

We recommend you get and display the title when processing a DataPackagePropertySetView object. It can help users distinguish between one share operation and another.

Values Values Values Values

Gets an enumerable collection that contains the values in the read-only dictionary.

This member is not implemented in C++IEnumerable<TValue> Values { get; }ReadOnly Property Values As IEnumerable(Of TValue)IEnumerable<TValue> Values { get; }
Value

An enumerable collection that contains the values in the read-only dictionary.

Methods

ContainsKey(TKey) ContainsKey(TKey) ContainsKey(TKey) ContainsKey(TKey)

Determines whether the read-only dictionary contains an element that has the specified key.

This member is not implemented in C++bool ContainsKey(TKey key)Function ContainsKey(key As TKey) As Booleanbool ContainsKey(TKey key)
Parameters
key
TKey TKey TKey TKey

The key to locate.

Returns

true if the read-only dictionary contains an element that has the specified key; otherwise, false.

Exceptions

key is null.

First() First() First() First()

Returns an iterator to enumerate the items in the property set.

public : IIterator<IKeyValuePair<PlatForm::String, PlatForm::Object>> First()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Returns
IIterator<IKeyValuePair<PlatForm::String, PlatForm::Object>> IIterator<KeyValuePair<string, object>> IIterator<KeyValuePair<string, object>> IIterator<KeyValuePair<string, object>>

The first item in the DataPackage object.

Remarks

For more info, see IIterable(IKeyValuePair).

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the collection.

This member is not implemented in C++IEnumerator<T> GetEnumerator()Function GetEnumerator As IEnumerator(Of T)IEnumerator<T> GetEnumerator()
Returns

An enumerator that can be used to iterate through the collection.

HasKey(String) HasKey(String) HasKey(String) HasKey(String)

Indicates whether the DataPackagePropertySetView object contains a specific property.

public : PlatForm::Boolean HasKey(PlatForm::String key)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Parameters
key
PlatForm::String String String String

The key.

Returns
PlatForm::Boolean bool bool bool

True if the property set has an item with the specified key; otherwise false.

Remarks

With the DataPackagePropertySetView class, use HasKey as a way to see whether the object contains a specific property. This is useful in situations where your app requires a custom property that the DataPackagePropertySetView object doesn't directly support. For more info, see IMapView(String, Object).

Lookup(String) Lookup(String) Lookup(String) Lookup(String)

Retrieves the value of a specific property.

public : PlatForm::Object Lookup(PlatForm::String key)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Parameters
key
PlatForm::String String String String

The key.

Returns
PlatForm::Object object object object

The value, if an item with the specified key exists. Use the HasKey method to determine whether the key exists.

Remarks

With the LookUp method, you specify the name of the property that you want. This name can be a property that the object supports directly, such as title, or a custom property defined by the source app.

For more info, see IMapView(String, Object).

Split(IMapView<String, Object>, IMapView<String, Object>) Split(IMapView<String, Object>, IMapView<String, Object>) Split(IMapView<String, Object>, IMapView<String, Object>) Split(IMapView<String, Object>, IMapView<String, Object>)

Divides the object into two views

public : void Split(IMapView<PlatForm::String, PlatForm::Object> first, IMapView<PlatForm::String, PlatForm::Object> second)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Parameters
first
IMapView<PlatForm::String, PlatForm::Object> IReadOnlyDictionary<String, Object> IReadOnlyDictionary<String, Object> IReadOnlyDictionary<String, Object>

The first half of the object.

second
IMapView<PlatForm::String, PlatForm::Object> IReadOnlyDictionary<String, Object> IReadOnlyDictionary<String, Object> IReadOnlyDictionary<String, Object>

The second half of the object.

TryGetValue(TKey, out TValue) TryGetValue(TKey, out TValue) TryGetValue(TKey, out TValue) TryGetValue(TKey, out TValue)

Gets the value that is associated with the specified key.

This member is not implemented in C++bool TryGetValue(TKey key, out TValue value)Function TryGetValue(key As TKey, ByRef value As TValue) As Booleanbool TryGetValue(TKey key, out TValue value)
Parameters
key
TKey TKey TKey TKey

The key to locate.

value
TValue TValue TValue TValue

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

true if the object that implements the System.Collections.Generic.IReadOnlyDictionary`2 interface contains an element that has the specified key; otherwise, false.

Exceptions

key is null.