TransferTarget.DisplayIcon Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The DisplayIcon property gets the icon associated with the transfer target. This icon is typically used to visually represent the target in the user interface.
public:
property IRandomAccessStreamReference ^ DisplayIcon { IRandomAccessStreamReference ^ get(); };
/// [Windows.Foundation.Metadata.Experimental]
/// [get: Windows.Foundation.Metadata.Experimental]
IRandomAccessStreamReference DisplayIcon();
[Windows.Foundation.Metadata.Experimental]
public IRandomAccessStreamReference DisplayIcon { [Windows.Foundation.Metadata.Experimental] get; }
var iRandomAccessStreamReference = transferTarget.displayIcon;
Public ReadOnly Property DisplayIcon As IRandomAccessStreamReference
Property Value
A IRandomAccessStreamReference that represents the icon of the transfer target.
- Attributes
Examples
Example: Displaying the Icon of a Transfer Target
var icon = transferTarget.DisplayIcon;
if (icon != null)
{
// Use the icon in the UI
var bitmapImage = new BitmapImage();
bitmapImage.SetSource(await icon.OpenReadAsync());
myImageControl.Source = bitmapImage;
}
else
{
// Handle the case where no icon is available
myImageControl.Source = null;
}
Remarks
The DisplayIcon property provides a way to retrieve the visual representation of a transfer target. Applications can use this property to display the icon in their user interface, making it easier for users to identify the target.
Usage Notes:
- The icon can be displayed in lists or dialogs where transfer targets are presented to the user.
- Ensure that the application handles cases where the icon might not be available.