Skip to content

Commit b494599

Browse files
Disabled dragging in recycle bin
1 parent bf979b8 commit b494599

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Files.Uwp/BaseLayout.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,19 @@ protected virtual void Page_CharacterReceived(CoreWindow sender, CharacterReceiv
813813
}
814814
}
815815

816+
private readonly RecycleBinHelpers recycleBinHelpers = new();
817+
816818
protected void FileList_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
817819
{
820+
foreach(var item in e.Items.OfType<ListedItem>())
821+
{
822+
if(recycleBinHelpers.IsPathUnderRecycleBin(item.ItemPath))
823+
{
824+
e.Cancel = true;
825+
return;
826+
}
827+
}
828+
818829
e.Items.OfType<ListedItem>().ForEach(item => SelectedItems.Add(item));
819830

820831
try

0 commit comments

Comments
 (0)