@@ -448,11 +448,7 @@ public async Task<bool> OpenPath(string path, FilesystemItemType? itemType = nul
448
448
449
449
if ( itemType == null || isShortcutItem || isHiddenItem )
450
450
{
451
- if ( isHiddenItem )
452
- {
453
- itemType = NativeFileOperationsHelper . HasFileAttribute ( path , System . IO . FileAttributes . Directory ) ? FilesystemItemType . Directory : FilesystemItemType . File ;
454
- }
455
- else if ( isShortcutItem )
451
+ if ( isShortcutItem )
456
452
{
457
453
AppServiceResponse response = await Connection . SendMessageAsync ( new ValueSet ( )
458
454
{
@@ -469,13 +465,17 @@ public async Task<bool> OpenPath(string path, FilesystemItemType? itemType = nul
469
465
shortcutRunAsAdmin = response . Message . Get ( "RunAsAdmin" , false ) ;
470
466
shortcutIsFolder = response . Message . Get ( "IsFolder" , false ) ;
471
467
472
- itemType = FilesystemItemType . File ; // Set to file here, because the logic is the same in both scenarios
468
+ itemType = shortcutIsFolder ? FilesystemItemType . Directory : FilesystemItemType . File ;
473
469
}
474
470
else
475
471
{
476
472
return false ;
477
473
}
478
474
}
475
+ else if ( isHiddenItem )
476
+ {
477
+ itemType = NativeFileOperationsHelper . HasFileAttribute ( path , System . IO . FileAttributes . Directory ) ? FilesystemItemType . Directory : FilesystemItemType . File ;
478
+ }
479
479
else
480
480
{
481
481
itemType = await StorageItemHelpers . GetTypeFromPath ( path , AssociatedInstance ) ;
@@ -486,7 +486,26 @@ public async Task<bool> OpenPath(string path, FilesystemItemType? itemType = nul
486
486
487
487
if ( itemType == FilesystemItemType . Directory ) // OpenDirectory
488
488
{
489
- if ( isHiddenItem )
489
+ if ( isShortcutItem )
490
+ {
491
+ if ( string . IsNullOrEmpty ( shortcutTargetPath ) )
492
+ {
493
+ await InvokeWin32ComponentAsync ( path ) ;
494
+ return true ;
495
+ }
496
+ else
497
+ {
498
+ AssociatedInstance . NavigationToolbar . PathControlDisplayText = shortcutTargetPath ;
499
+ AssociatedInstance . ContentFrame . Navigate ( AssociatedInstance . InstanceViewModel . FolderSettings . GetLayoutType ( shortcutTargetPath ) , new NavigationArguments ( )
500
+ {
501
+ NavPathParam = shortcutTargetPath ,
502
+ AssociatedTabInstance = AssociatedInstance
503
+ } , new SuppressNavigationTransitionInfo ( ) ) ;
504
+
505
+ return true ;
506
+ }
507
+ }
508
+ else if ( isHiddenItem )
490
509
{
491
510
AssociatedInstance . NavigationToolbar . PathControlDisplayText = path ;
492
511
AssociatedInstance . ContentFrame . Navigate ( AssociatedInstance . InstanceViewModel . FolderSettings . GetLayoutType ( path ) , new NavigationArguments ( )
@@ -522,11 +541,7 @@ public async Task<bool> OpenPath(string path, FilesystemItemType? itemType = nul
522
541
}
523
542
else if ( itemType == FilesystemItemType . File ) // OpenFile
524
543
{
525
- if ( isHiddenItem )
526
- {
527
- await InvokeWin32ComponentAsync ( path ) ;
528
- }
529
- else if ( isShortcutItem )
544
+ if ( isShortcutItem )
530
545
{
531
546
if ( string . IsNullOrEmpty ( shortcutTargetPath ) )
532
547
{
@@ -547,6 +562,10 @@ public async Task<bool> OpenPath(string path, FilesystemItemType? itemType = nul
547
562
}
548
563
opened = ( FilesystemResult ) true ;
549
564
}
565
+ else if ( isHiddenItem )
566
+ {
567
+ await InvokeWin32ComponentAsync ( path ) ;
568
+ }
550
569
else
551
570
{
552
571
opened = await AssociatedInstance . FilesystemViewModel . GetFileWithPathFromPathAsync ( path )
0 commit comments