Skip to content

Commit 1aac33a

Browse files
committed
Apply suggestions from code review
1 parent 4ded089 commit 1aac33a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

windows.applicationmodel.datatransfer/transfertarget_displayicon.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ var icon = transferTarget.DisplayIcon;
4040
if (icon != null)
4141
{
4242
// Use the icon in the UI
43-
Console.WriteLine("Icon retrieved successfully.");
43+
var bitmapImage = new BitmapImage();
44+
bitmapImage.SetSource(await icon.OpenReadAsync());
45+
myImageControl.Source = bitmapImage;
4446
}
4547
else
4648
{
47-
Console.WriteLine("No icon available for this target.");
49+
// Handle the case where no icon is available
50+
myImageControl.Source = null;
4851
}
4952
```

0 commit comments

Comments
 (0)