Skip to content

Commit 1c53ea6

Browse files
authored
Provide dragged files as StorageFile when possible (#6698)
1 parent 382d5d8 commit 1c53ea6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Files/BaseLayout.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,11 @@ protected async void FileList_DragItemsStarting(object sender, DragItemsStarting
821821
return;
822822
}
823823

824+
var onlyStandard = selectedStorageItems.All(x => x is StorageFile || x is StorageFolder || x is SystemStorageFile || x is SystemStorageFolder);
825+
if (onlyStandard)
826+
{
827+
selectedStorageItems = await selectedStorageItems.ToStandardStorageItemsAsync();
828+
}
824829
if (selectedStorageItems.Count == 1)
825830
{
826831
if (selectedStorageItems[0] is IStorageFile file)

Files/Filesystem/StorageFileHelpers/StorageFileExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public static async Task<List<IStorageItem>> ToStandardStorageItemsAsync(this IE
369369
}
370370
catch (NotSupportedException)
371371
{
372-
// Ignore items that can0t be converted
372+
// Ignore items that can't be converted
373373
}
374374
}
375375
return newItems;

0 commit comments

Comments
 (0)