File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
src/Files.App/Views/Layouts Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,34 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
103103 var path = navigationArguments . NavPathParam ;
104104 var pathRoot = GetPathRoot ( path ) ;
105105 var pathStack = new Stack < string > ( ) ;
106+ var storageTrashBinService = Ioc . Default . GetRequiredService < IStorageTrashBinService > ( ) ;
107+ if ( storageTrashBinService . IsUnderTrashBin ( path ) )
108+ {
109+ var recycleBinPath = $ "{ pathRoot } $Recycle.Bin";
110+ var tempPath = path ;
111+ var pathsToAdd = new List < string > ( ) ;
112+
113+ while ( ! string . IsNullOrEmpty ( tempPath ) )
114+ {
115+ var parentPath = GetParentDir ( tempPath ) ;
116+
117+ if ( ! string . IsNullOrEmpty ( parentPath ) && parentPath . Equals ( recycleBinPath , StringComparison . OrdinalIgnoreCase ) )
118+ // SID folder? stop here
119+ break ;
120+
121+ if ( tempPath . Equals ( recycleBinPath , StringComparison . OrdinalIgnoreCase ) )
122+ break ;
106123
107- if ( ! string . IsNullOrEmpty ( pathRoot ) )
124+ pathsToAdd . Add ( tempPath ) ;
125+ tempPath = parentPath ;
126+ }
127+
128+ foreach ( var pathToAdd in pathsToAdd )
129+ pathStack . Push ( pathToAdd ) ;
130+
131+ path = Constants . UserEnvironmentPaths . RecycleBinPath ;
132+ }
133+ else if ( ! string . IsNullOrEmpty ( pathRoot ) )
108134 {
109135 var rootPathList = App . QuickAccessManager . Model . PinnedFolders . Select ( NormalizePath )
110136 . Concat ( CloudDrivesManager . Drives . Select ( x => NormalizePath ( x . Path ) ) ) . ToList ( )
You can’t perform that action at this time.
0 commit comments