DataPackagePropertySetView DataPackagePropertySetView DataPackagePropertySetView 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
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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.

Examples

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

Properties

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
Value
Uri Uri Uri

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

Attributes

ApplicationName ApplicationName ApplicationName

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

public string ApplicationName { get; }public string ApplicationName { get; }Public ReadOnly Property ApplicationName As string
Value
string string string

The name of the app that created the DataPackage object.

Attributes

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
Value
Uri Uri Uri

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

Attributes

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.

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
Value
Uri Uri Uri

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

Attributes

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

Gets the text that describes the contents of the DataPackage.

public string Description { get; }public string Description { get; }Public ReadOnly Property Description As string
Value
string string string

Text that describes the contents of the DataPackage.

Attributes

EnterpriseId EnterpriseId EnterpriseId

Gets or sets the enterprise Id.

public string EnterpriseId { get; }public string EnterpriseId { get; }Public ReadOnly Property EnterpriseId As string
Value
string string string

The enterprise Id.

Attributes

FileTypes FileTypes FileTypes

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

public IVectorView<string> FileTypes { get; }public IVectorView<string> FileTypes { get; }Public ReadOnly Property FileTypes As IVectorView<string>
Value

Contains the types of files stored in the DataPackage object.

Attributes

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 TValue
Parameters
key
TKey TKey TKey

The key to locate.

Value
TValue TValue TValue

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

Attributes

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)
Value
System.Collections.Generic.IEnumerable<TKey> System.Collections.Generic.IEnumerable<TKey> System.Collections.Generic.IEnumerable<TKey>

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

Attributes

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
Value
Color Color Color

The background color for the sharing app's Square30x30Logo.

Attributes

PackageFamilyName PackageFamilyName PackageFamilyName

Gets the package family name of the source app.

public string PackageFamilyName { get; }public string PackageFamilyName { get; }Public ReadOnly Property PackageFamilyName As string
Value
string string string

The package family name.

Attributes

Size Size Size

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

public uint Size { get; }This member is not implemented in C#This member is not implemented in VB.Net
Value
uint uint uint

The number of elements in the property set.

Attributes

Remarks

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

Gets the source app's logo.

public IRandomAccessStreamReference Square30x30Logo { get; }public IRandomAccessStreamReference Square30x30Logo { get; }Public ReadOnly Property Square30x30Logo As IRandomAccessStreamReference
Attributes

Remarks

The logo is padded with the color in LogoBackgroundColor.

Thumbnail Thumbnail Thumbnail

Gets the thumbnail image for the DataPackageView.

public RandomAccessStreamReference Thumbnail { get; }public RandomAccessStreamReference Thumbnail { get; }Public ReadOnly Property Thumbnail As RandomAccessStreamReference
Attributes

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.

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

Title Title Title

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

public string Title { get; }public string Title { get; }Public ReadOnly Property Title As string
Value
string string string

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

Attributes

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

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)
Value
System.Collections.Generic.IEnumerable<TValue> System.Collections.Generic.IEnumerable<TValue> System.Collections.Generic.IEnumerable<TValue>

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

Attributes

Methods

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 Boolean
Parameters
key
TKey TKey TKey

The key to locate.

Returns
System.Boolean System.Boolean System.Boolean

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

Attributes

First() First() First()

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

public IIterator<IKeyValuePair<string, object>> First()This member is not implemented in C#This member is not implemented in VB.Net
Returns

The first item in the DataPackage object.

Attributes

Remarks

For more info, see IIterable(IKeyValuePair).

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)
Returns
System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerator<T>

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

Attributes
See Also
System.Collections.Generic.IEnumerator<T>System.Collections.Generic.IEnumerator<T>System.Collections.Generic.IEnumerator<T>

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

Indicates whether the DataPackagePropertySetView object contains a specific property.

public bool HasKey(String key)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
key
System.String System.String System.String

The key.

Returns
bool bool bool

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

Attributes

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)

Retrieves the value of a specific property.

public object Lookup(String key)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
key
System.String System.String System.String

The key.

Returns
object object object

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

Attributes

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

Divides the object into two views

public void Split(IMapView<String, Object> first, IMapView<String, Object> second)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
first

The first half of the object.

second

The second half of the object.

Attributes

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 Boolean
Parameters
key
TKey TKey TKey

The key to locate.

value
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
System.Boolean System.Boolean System.Boolean

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

Attributes