@@ -1077,26 +1077,19 @@ private List<ContextMenuFlyoutItemViewModel> GetLocationItemMenuItems(INavigatio
1077
1077
} . Where ( x => x . ShowItem ) . ToList ( ) ;
1078
1078
}
1079
1079
1080
- public async void HandleItemDragOverAsync ( ItemDragOverEventArgs args )
1080
+ public async Task HandleItemDragOverAsync ( ItemDragOverEventArgs args )
1081
1081
{
1082
1082
if ( args . DropTarget is LocationItem locationItem )
1083
- {
1084
- HandleLocationItemDragOverAsync ( locationItem , args ) ;
1085
- }
1083
+ await HandleLocationItemDragOverAsync ( locationItem , args ) ;
1086
1084
else if ( args . DropTarget is DriveItem driveItem )
1087
- {
1088
- HandleDriveItemDragOverAsync ( driveItem , args ) ;
1089
- }
1085
+ await HandleDriveItemDragOverAsync ( driveItem , args ) ;
1090
1086
else if ( args . DropTarget is FileTagItem fileTagItem )
1091
- {
1092
- HandleTagItemDragOverAsync ( fileTagItem , args ) ;
1093
- }
1087
+ await HandleTagItemDragOverAsync ( fileTagItem , args ) ;
1094
1088
}
1095
1089
1096
- private async void HandleLocationItemDragOverAsync ( LocationItem locationItem , ItemDragOverEventArgs args )
1090
+ private async Task HandleLocationItemDragOverAsync ( LocationItem locationItem , ItemDragOverEventArgs args )
1097
1091
{
1098
1092
var rawEvent = args . RawEvent ;
1099
- var deferral = rawEvent . GetDeferral ( ) ;
1100
1093
1101
1094
if ( Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
1102
1095
{
@@ -1173,16 +1166,13 @@ private async void HandleLocationItemDragOverAsync(LocationItem locationItem, It
1173
1166
CompleteDragEventArgs ( rawEvent , captionText , operationType ) ;
1174
1167
}
1175
1168
}
1176
-
1177
- deferral . Complete ( ) ;
1178
1169
}
1179
1170
1180
- private async void HandleDriveItemDragOverAsync ( DriveItem driveItem , ItemDragOverEventArgs args )
1171
+ private async Task HandleDriveItemDragOverAsync ( DriveItem driveItem , ItemDragOverEventArgs args )
1181
1172
{
1182
1173
if ( ! Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
1183
1174
return ;
1184
1175
1185
- var deferral = args . RawEvent . GetDeferral ( ) ;
1186
1176
args . RawEvent . Handled = true ;
1187
1177
1188
1178
var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
@@ -1228,16 +1218,13 @@ private async void HandleDriveItemDragOverAsync(DriveItem driveItem, ItemDragOve
1228
1218
}
1229
1219
CompleteDragEventArgs ( args . RawEvent , captionText , operationType ) ;
1230
1220
}
1231
-
1232
- deferral . Complete ( ) ;
1233
1221
}
1234
1222
1235
- private async void HandleTagItemDragOverAsync ( FileTagItem tagItem , ItemDragOverEventArgs args )
1223
+ private async Task HandleTagItemDragOverAsync ( FileTagItem tagItem , ItemDragOverEventArgs args )
1236
1224
{
1237
1225
if ( ! Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
1238
1226
return ;
1239
1227
1240
- var deferral = args . RawEvent . GetDeferral ( ) ;
1241
1228
args . RawEvent . Handled = true ;
1242
1229
1243
1230
var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
@@ -1252,32 +1239,23 @@ private async void HandleTagItemDragOverAsync(FileTagItem tagItem, ItemDragOverE
1252
1239
args . RawEvent . DragUIOverride . Caption = string . Format ( "LinkToFolderCaptionText" . GetLocalizedResource ( ) , tagItem . Text ) ;
1253
1240
args . RawEvent . AcceptedOperation = DataPackageOperation . Link ;
1254
1241
}
1255
-
1256
- deferral . Complete ( ) ;
1257
1242
}
1258
1243
1259
1244
1260
- public async void HandleItemDroppedAsync ( ItemDroppedEventArgs args )
1245
+ public async Task HandleItemDroppedAsync ( ItemDroppedEventArgs args )
1261
1246
{
1262
1247
if ( args . DropTarget is LocationItem locationItem )
1263
- {
1264
- HandleLocationItemDroppedAsync ( locationItem , args ) ;
1265
- }
1248
+ await HandleLocationItemDroppedAsync ( locationItem , args ) ;
1266
1249
else if ( args . DropTarget is DriveItem driveItem )
1267
- {
1268
- HandleDriveItemDroppedAsync ( driveItem , args ) ;
1269
- }
1250
+ await HandleDriveItemDroppedAsync ( driveItem , args ) ;
1270
1251
else if ( args . DropTarget is FileTagItem fileTagItem )
1271
- {
1272
- HandleTagItemDroppedAsync ( fileTagItem , args ) ;
1273
- }
1252
+ await HandleTagItemDroppedAsync ( fileTagItem , args ) ;
1274
1253
}
1275
1254
1276
- private async void HandleLocationItemDroppedAsync ( LocationItem locationItem , ItemDroppedEventArgs args )
1255
+ private async Task HandleLocationItemDroppedAsync ( LocationItem locationItem , ItemDroppedEventArgs args )
1277
1256
{
1278
1257
if ( Utils . Storage . FilesystemHelpers . HasDraggedStorageItems ( args . DroppedItem ) )
1279
1258
{
1280
- var deferral = args . RawEvent . GetDeferral ( ) ;
1281
1259
if ( string . IsNullOrEmpty ( locationItem . Path ) && SectionType . Favorites . Equals ( locationItem . Section ) ) // Pin to Favorites section
1282
1260
{
1283
1261
var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
@@ -1291,24 +1269,16 @@ private async void HandleLocationItemDroppedAsync(LocationItem locationItem, Ite
1291
1269
{
1292
1270
await FilesystemHelpers . PerformOperationTypeAsync ( args . RawEvent . AcceptedOperation , args . DroppedItem , locationItem . Path , false , true ) ;
1293
1271
}
1294
- deferral . Complete ( ) ;
1295
1272
}
1296
1273
}
1297
1274
1298
- private async void HandleDriveItemDroppedAsync ( DriveItem driveItem , ItemDroppedEventArgs args )
1275
+ private Task HandleDriveItemDroppedAsync ( DriveItem driveItem , ItemDroppedEventArgs args )
1299
1276
{
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 ) ;
1306
1278
}
1307
1279
1308
- private async void HandleTagItemDroppedAsync ( FileTagItem fileTagItem , ItemDroppedEventArgs args )
1280
+ private async Task HandleTagItemDroppedAsync ( FileTagItem fileTagItem , ItemDroppedEventArgs args )
1309
1281
{
1310
- var deferral = args . RawEvent . GetDeferral ( ) ;
1311
-
1312
1282
var storageItems = await Utils . Storage . FilesystemHelpers . GetDraggedStorageItems ( args . DroppedItem ) ;
1313
1283
foreach ( var item in storageItems . Where ( x => ! string . IsNullOrEmpty ( x . Path ) ) )
1314
1284
{
@@ -1319,9 +1289,6 @@ private async void HandleTagItemDroppedAsync(FileTagItem fileTagItem, ItemDroppe
1319
1289
FileTags = new [ ] { fileTagItem . FileTag . Uid }
1320
1290
} ;
1321
1291
}
1322
-
1323
- deferral . Complete ( ) ;
1324
- await Task . Yield ( ) ;
1325
1292
}
1326
1293
1327
1294
private static DragEventArgs CompleteDragEventArgs ( DragEventArgs e , string captionText , DataPackageOperation operationType )
0 commit comments