@@ -60,6 +60,24 @@ public bool ShowUnpinItem
60
60
}
61
61
}
62
62
63
+ private bool _ShowProperties ;
64
+
65
+ public bool ShowProperties
66
+ {
67
+ get
68
+ {
69
+ return _ShowProperties ;
70
+ }
71
+ set
72
+ {
73
+ if ( value != _ShowProperties )
74
+ {
75
+ _ShowProperties = value ;
76
+ NotifyPropertyChanged ( nameof ( ShowProperties ) ) ;
77
+ }
78
+ }
79
+ }
80
+
63
81
private bool _ShowEmptyRecycleBin ;
64
82
65
83
public bool ShowEmptyRecycleBin
@@ -195,10 +213,19 @@ private async void NavigationViewLocationItem_RightTapped(object sender, RightTa
195
213
196
214
ShowEmptyRecycleBin = true ;
197
215
ShowUnpinItem = true ;
216
+ ShowProperties = false ;
198
217
}
199
218
else
200
219
{
201
220
ShowEmptyRecycleBin = false ;
221
+ // Set to true if properties should be displayed for pinned folders
222
+ ShowProperties = false ;
223
+ }
224
+
225
+ // Additional check needed because ShowProperties is set to true if not recycle bin
226
+ if ( item . IsDefaultLocation )
227
+ {
228
+ ShowProperties = false ;
202
229
}
203
230
204
231
SideBarItemContextFlyout . ShowAt ( sidebarItem , e . GetPosition ( sidebarItem ) ) ;
@@ -211,6 +238,7 @@ private void NavigationViewDriveItem_RightTapped(object sender, RightTappedRoute
211
238
212
239
ShowUnpinItem = false ;
213
240
ShowEmptyRecycleBin = false ;
241
+ ShowProperties = true ;
214
242
215
243
SideBarItemContextFlyout . ShowAt ( sidebarItem , e . GetPosition ( sidebarItem ) ) ;
216
244
@@ -259,19 +287,19 @@ private async void NavigationViewLocationItem_DragOver(object sender, DragEventA
259
287
locationItem . Path . Equals ( App . AppSettings . RecycleBinPath , StringComparison . OrdinalIgnoreCase ) ||
260
288
storageItems . AreItemsAlreadyInFolder ( locationItem . Path ) )
261
289
{
262
- e . AcceptedOperation = Windows . ApplicationModel . DataTransfer . DataPackageOperation . None ;
290
+ e . AcceptedOperation = DataPackageOperation . None ;
263
291
}
264
292
else
265
293
{
266
294
e . DragUIOverride . IsCaptionVisible = true ;
267
295
if ( storageItems . AreItemsInSameDrive ( locationItem . Path ) )
268
296
{
269
- e . AcceptedOperation = Windows . ApplicationModel . DataTransfer . DataPackageOperation . Move ;
297
+ e . AcceptedOperation = DataPackageOperation . Move ;
270
298
e . DragUIOverride . Caption = string . Format ( ResourceController . GetTranslation ( "MoveToFolderCaptionText" ) , locationItem . Text ) ;
271
299
}
272
300
else
273
301
{
274
- e . AcceptedOperation = Windows . ApplicationModel . DataTransfer . DataPackageOperation . Copy ;
302
+ e . AcceptedOperation = DataPackageOperation . Copy ;
275
303
e . DragUIOverride . Caption = string . Format ( ResourceController . GetTranslation ( "CopyToFolderCaptionText" ) , locationItem . Text ) ;
276
304
}
277
305
}
@@ -302,19 +330,19 @@ private async void NavigationViewDriveItem_DragOver(object sender, DragEventArgs
302
330
"Unknown" . Equals ( driveItem . SpaceText , StringComparison . OrdinalIgnoreCase ) ||
303
331
storageItems . AreItemsAlreadyInFolder ( driveItem . Path ) )
304
332
{
305
- e . AcceptedOperation = Windows . ApplicationModel . DataTransfer . DataPackageOperation . None ;
333
+ e . AcceptedOperation = DataPackageOperation . None ;
306
334
}
307
335
else
308
336
{
309
337
e . DragUIOverride . IsCaptionVisible = true ;
310
338
if ( storageItems . AreItemsInSameDrive ( driveItem . Path ) )
311
339
{
312
- e . AcceptedOperation = Windows . ApplicationModel . DataTransfer . DataPackageOperation . Move ;
340
+ e . AcceptedOperation = DataPackageOperation . Move ;
313
341
e . DragUIOverride . Caption = string . Format ( ResourceController . GetTranslation ( "MoveToFolderCaptionText" ) , driveItem . Text ) ;
314
342
}
315
343
else
316
344
{
317
- e . AcceptedOperation = Windows . ApplicationModel . DataTransfer . DataPackageOperation . Copy ;
345
+ e . AcceptedOperation = DataPackageOperation . Copy ;
318
346
e . DragUIOverride . Caption = string . Format ( ResourceController . GetTranslation ( "CopyToFolderCaptionText" ) , driveItem . Text ) ;
319
347
}
320
348
}
@@ -331,6 +359,28 @@ private void NavigationViewDriveItem_Drop(object sender, DragEventArgs e)
331
359
ItemOperations . PasteItemWithStatus ( e . DataView , driveItem . Path , e . AcceptedOperation ) ;
332
360
deferral . Complete ( ) ;
333
361
}
362
+
363
+ private async void Properties_Click ( object sender , RoutedEventArgs e )
364
+ {
365
+ var item = ( sender as MenuFlyoutItem ) . DataContext ;
366
+
367
+ if ( item is DriveItem )
368
+ {
369
+ await App . CurrentInstance . InteractionOperations . OpenPropertiesWindow ( item ) ;
370
+ }
371
+ else if ( item is LocationItem )
372
+ {
373
+ ListedItem listedItem = new ListedItem ( null )
374
+ {
375
+ ItemPath = ( item as LocationItem ) . Path ,
376
+ ItemName = ( item as LocationItem ) . Text ,
377
+ PrimaryItemAttribute = Windows . Storage . StorageItemTypes . Folder ,
378
+ ItemType = ResourceController . GetTranslation ( "FileFolderListItem" ) ,
379
+ LoadFolderGlyph = true
380
+ } ;
381
+ await App . CurrentInstance . InteractionOperations . OpenPropertiesWindow ( listedItem ) ;
382
+ }
383
+ }
334
384
}
335
385
336
386
public class NavItemDataTemplateSelector : DataTemplateSelector
0 commit comments