@@ -1077,26 +1077,19 @@ private List<ContextMenuFlyoutItemViewModel> GetLocationItemMenuItems(INavigatio
10771077 } . Where ( x => x . ShowItem ) . ToList ( ) ;
10781078 }
10791079
1080- public async void HandleItemDragOverAsync ( ItemDragOverEventArgs args )
1080+ public async Task HandleItemDragOverAsync ( ItemDragOverEventArgs args )
10811081 {
10821082 if ( args . DropTarget is LocationItem locationItem )
1083- {
1084- HandleLocationItemDragOverAsync ( locationItem , args ) ;
1085- }
1083+ await HandleLocationItemDragOverAsync ( locationItem , args ) ;
10861084 else if ( args . DropTarget is DriveItem driveItem )
1087- {
1088- HandleDriveItemDragOverAsync ( driveItem , args ) ;
1089- }
1085+ await HandleDriveItemDragOverAsync ( driveItem , args ) ;
10901086 else if ( args . DropTarget is FileTagItem fileTagItem )
1091- {
1092- HandleTagItemDragOverAsync ( fileTagItem , args ) ;
1093- }
1087+ await HandleTagItemDragOverAsync ( fileTagItem , args ) ;
10941088 }
10951089
1096- private async void HandleLocationItemDragOverAsync ( LocationItem locationItem , ItemDragOverEventArgs args )
1090+ private async Task HandleLocationItemDragOverAsync ( LocationItem locationItem , ItemDragOverEventArgs args )
10971091 {
10981092 var rawEvent = args . RawEvent ;
1099- var deferral = rawEvent . GetDeferral ( ) ;
11001093
11011094 if ( Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
11021095 {
@@ -1173,16 +1166,13 @@ private async void HandleLocationItemDragOverAsync(LocationItem locationItem, It
11731166 CompleteDragEventArgs ( rawEvent , captionText , operationType ) ;
11741167 }
11751168 }
1176-
1177- deferral . Complete ( ) ;
11781169 }
11791170
1180- private async void HandleDriveItemDragOverAsync ( DriveItem driveItem , ItemDragOverEventArgs args )
1171+ private async Task HandleDriveItemDragOverAsync ( DriveItem driveItem , ItemDragOverEventArgs args )
11811172 {
11821173 if ( ! Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
11831174 return ;
11841175
1185- var deferral = args . RawEvent . GetDeferral ( ) ;
11861176 args . RawEvent . Handled = true ;
11871177
11881178 var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
@@ -1228,16 +1218,13 @@ private async void HandleDriveItemDragOverAsync(DriveItem driveItem, ItemDragOve
12281218 }
12291219 CompleteDragEventArgs ( args . RawEvent , captionText , operationType ) ;
12301220 }
1231-
1232- deferral . Complete ( ) ;
12331221 }
12341222
1235- private async void HandleTagItemDragOverAsync ( FileTagItem tagItem , ItemDragOverEventArgs args )
1223+ private async Task HandleTagItemDragOverAsync ( FileTagItem tagItem , ItemDragOverEventArgs args )
12361224 {
12371225 if ( ! Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
12381226 return ;
12391227
1240- var deferral = args . RawEvent . GetDeferral ( ) ;
12411228 args . RawEvent . Handled = true ;
12421229
12431230 var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
@@ -1252,32 +1239,23 @@ private async void HandleTagItemDragOverAsync(FileTagItem tagItem, ItemDragOverE
12521239 args . RawEvent . DragUIOverride . Caption = string . Format ( "LinkToFolderCaptionText" . GetLocalizedResource ( ) , tagItem . Text ) ;
12531240 args . RawEvent . AcceptedOperation = DataPackageOperation . Link ;
12541241 }
1255-
1256- deferral . Complete ( ) ;
12571242 }
12581243
12591244
1260- public async void HandleItemDroppedAsync ( ItemDroppedEventArgs args )
1245+ public async Task HandleItemDroppedAsync ( ItemDroppedEventArgs args )
12611246 {
12621247 if ( args . DropTarget is LocationItem locationItem )
1263- {
1264- HandleLocationItemDroppedAsync ( locationItem , args ) ;
1265- }
1248+ await HandleLocationItemDroppedAsync ( locationItem , args ) ;
12661249 else if ( args . DropTarget is DriveItem driveItem )
1267- {
1268- HandleDriveItemDroppedAsync ( driveItem , args ) ;
1269- }
1250+ await HandleDriveItemDroppedAsync ( driveItem , args ) ;
12701251 else if ( args . DropTarget is FileTagItem fileTagItem )
1271- {
1272- HandleTagItemDroppedAsync ( fileTagItem , args ) ;
1273- }
1252+ await HandleTagItemDroppedAsync ( fileTagItem , args ) ;
12741253 }
12751254
1276- private async void HandleLocationItemDroppedAsync ( LocationItem locationItem , ItemDroppedEventArgs args )
1255+ private async Task HandleLocationItemDroppedAsync ( LocationItem locationItem , ItemDroppedEventArgs args )
12771256 {
12781257 if ( Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
12791258 {
1280- var deferral = args . RawEvent . GetDeferral ( ) ;
12811259 if ( string . IsNullOrEmpty ( locationItem . Path ) && SectionType . Favorites . Equals ( locationItem . Section ) ) // Pin to Favorites section
12821260 {
12831261 var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
@@ -1291,24 +1269,16 @@ private async void HandleLocationItemDroppedAsync(LocationItem locationItem, Ite
12911269 {
12921270 await FilesystemHelpers . PerformOperationTypeAsync ( args . RawEvent . AcceptedOperation , args . DroppedItem , locationItem . Path , false , true ) ;
12931271 }
1294- deferral . Complete ( ) ;
12951272 }
12961273 }
12971274
1298- private async void HandleDriveItemDroppedAsync ( DriveItem driveItem , ItemDroppedEventArgs args )
1275+ private Task HandleDriveItemDroppedAsync ( DriveItem driveItem , ItemDroppedEventArgs args )
12991276 {
1300- var deferral = args . RawEvent . GetDeferral ( ) ;
1301-
1302- await FilesystemHelpers . PerformOperationTypeAsync ( args . RawEvent . AcceptedOperation , args . RawEvent . DataView , driveItem . Path , false , true ) ;
1303-
1304- deferral . Complete ( ) ;
1305- await Task . Yield ( ) ;
1277+ return FilesystemHelpers . PerformOperationTypeAsync ( args . RawEvent . AcceptedOperation , args . RawEvent . DataView , driveItem . Path , false , true ) ;
13061278 }
13071279
1308- private async void HandleTagItemDroppedAsync ( FileTagItem fileTagItem , ItemDroppedEventArgs args )
1280+ private async Task HandleTagItemDroppedAsync ( FileTagItem fileTagItem , ItemDroppedEventArgs args )
13091281 {
1310- var deferral = args . RawEvent . GetDeferral ( ) ;
1311-
13121282 var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
13131283 foreach ( var item in storageItems . Where ( x => ! string . IsNullOrEmpty ( x . Path ) ) )
13141284 {
@@ -1319,9 +1289,6 @@ private async void HandleTagItemDroppedAsync(FileTagItem fileTagItem, ItemDroppe
13191289 FileTags = new [ ] { fileTagItem . FileTag . Uid }
13201290 } ;
13211291 }
1322-
1323- deferral . Complete ( ) ;
1324- await Task . Yield ( ) ;
13251292 }
13261293
13271294 private static DragEventArgs CompleteDragEventArgs ( DragEventArgs e , string captionText , DataPackageOperation operationType )
0 commit comments