DataPackagePropertySetView DataPackagePropertySetView DataPackagePropertySetView DataPackagePropertySetView Class

Gets the set of properties of a DataPackageView object.

Syntax

Declaration

public sealed class DataPackagePropertySetViewpublic sealed class DataPackagePropertySetViewPublic NotInheritable Class DataPackagePropertySetView

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(System.String) 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 summary

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

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

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

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

Gets the text that describes the contents of the DataPackage.

Gets or sets the enterprise Id.

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

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

Gets the package family name of the source app.

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

Gets the source app's logo.

Gets the thumbnail image for the DataPackageView.

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

Methods summary

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

Indicates whether the DataPackagePropertySetView object contains a specific property.

Retrieves the value of a specific property.

Divides the object into two views

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

    Property Value

    • 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 string ApplicationName { get; }public string ApplicationName { get; }Public ReadOnly Property ApplicationName As string

    Property Value

    • string
      string
      string
      string

      The name of the app that created the DataPackage object.

  • Description
    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

    Property Value

    • string
      string
      string
      string

      Text that describes the contents of the DataPackage.

  • EnterpriseId
    EnterpriseId
    EnterpriseId
    EnterpriseId

    Gets or sets the enterprise Id.

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

    Property Value

    • 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 IVectorView<string> FileTypes { get; }Public ReadOnly Property FileTypes As IVectorView<string>

    Property Value

    • Contains the types of files stored in the DataPackage object.

  • 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

    Property Value

  • PackageFamilyName
    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

    Property Value

    • 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 uint Size { get; }public uint Size { get; }Public ReadOnly Property Size As uint

    Property Value

    • uint
      uint
      uint
      uint

      The number of elements in the property set.

    Remarks

    For more info, see IMapView<K, V>.

  • 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

    Property Value

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

    Property Value

    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.

Methods

  • First()
    First()
    First()
    First()

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

    public IIterator<IKeyValuePair<string, object>> First()public IIterator<IKeyValuePair<string, object>> First()Public Function First() As IIterator( Of IKeyValuePairstring, object )

    Returns

    Remarks

    For more info, see IIterable<T>.

  • HasKey(System.String)
    HasKey(System.String)
    HasKey(System.String)
    HasKey(System.String)

    Indicates whether the DataPackagePropertySetView object contains a specific property.

    public bool HasKey(System.String key)public bool HasKey(System.String key)Public Function HasKey(key As System.String) As bool

    Parameters

    • key
      System.String
      System.String
      System.String
      System.String

      The key.

    Returns

    • bool
      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<K, V>.

  • Lookup(System.String)
    Lookup(System.String)
    Lookup(System.String)
    Lookup(System.String)

    Retrieves the value of a specific property.

    public object Lookup(System.String key)public object Lookup(System.String key)Public Function Lookup(key As System.String) As object

    Parameters

    • key
      System.String
      System.String
      System.String
      System.String

      The key.

    Returns

    • 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<K, V>.

  • Split(Windows.Foundation.Collections.IMapView{System.String, System.Object},Windows.Foundation.Collections.IMapView{System.String, System.Object})
    Split(Windows.Foundation.Collections.IMapView{System.String, System.Object},Windows.Foundation.Collections.IMapView{System.String, System.Object})
    Split(Windows.Foundation.Collections.IMapView{System.String, System.Object},Windows.Foundation.Collections.IMapView{System.String, System.Object})
    Split(Windows.Foundation.Collections.IMapView{System.String, System.Object},Windows.Foundation.Collections.IMapView{System.String, System.Object})

    Divides the object into two views

    public void Split(Windows.Foundation.Collections.IMapView{System.String, System.Object} first,Windows.Foundation.Collections.IMapView{System.String, System.Object} second)public void Split(Windows.Foundation.Collections.IMapView{System.String, System.Object} first,Windows.Foundation.Collections.IMapView{System.String, System.Object} second)Public Function Split(first As Windows.Foundation.Collections.IMapView{System.String, System.Object},second As Windows.Foundation.Collections.IMapView{System.String, System.Object}) As void

    Parameters

    • first

      The first half of the object.

    • second

      The second half of the object.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute

Details

Assembly

Windows.ApplicationModel.DataTransfer.dll