File tree Expand file tree Collapse file tree 5 files changed +13
-10
lines changed
UserControls/MultitaskingControl Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -221,21 +221,22 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
221221 await App . CurrentInstance . FilesystemViewModel . SetWorkingDirectory ( parameters ) ;
222222
223223 // pathRoot will be empty on recycle bin path
224- string pathRoot = Path . GetPathRoot ( App . CurrentInstance . FilesystemViewModel . WorkingDirectory ) ;
225- if ( string . IsNullOrEmpty ( pathRoot ) || App . CurrentInstance . FilesystemViewModel . WorkingDirectory == pathRoot )
224+ var workingDir = App . CurrentInstance . FilesystemViewModel . WorkingDirectory ;
225+ string pathRoot = Path . GetPathRoot ( workingDir ) ;
226+ if ( string . IsNullOrEmpty ( pathRoot ) || workingDir == pathRoot )
226227 {
227228 App . CurrentInstance . NavigationToolbar . CanNavigateToParent = false ;
228229 }
229230 else
230231 {
231232 App . CurrentInstance . NavigationToolbar . CanNavigateToParent = true ;
232233 }
234+
233235 App . CurrentInstance . InstanceViewModel . IsPageTypeNotHome = true ; // show controls that were hidden on the home page
234- App . CurrentInstance . InstanceViewModel . IsPageTypeRecycleBin =
235- App . CurrentInstance . FilesystemViewModel . WorkingDirectory . StartsWith ( App . AppSettings . RecycleBinPath ) ;
236- App . CurrentInstance . InstanceViewModel . IsPageTypeMtpDevice =
237- App . CurrentInstance . FilesystemViewModel . WorkingDirectory . StartsWith ( "\\ \\ ?\\ " ) ;
236+ App . CurrentInstance . InstanceViewModel . IsPageTypeRecycleBin = workingDir . StartsWith ( App . AppSettings . RecycleBinPath ) ;
237+ App . CurrentInstance . InstanceViewModel . IsPageTypeMtpDevice = workingDir . StartsWith ( "\\ \\ ?\\ " ) ;
238238
239+ await App . CurrentInstance . MultitaskingControl ? . SetSelectedTabInfo ( new DirectoryInfo ( workingDir ) . Name , workingDir ) ;
239240 App . CurrentInstance . FilesystemViewModel . RefreshItems ( ) ;
240241
241242 App . CurrentInstance . MultitaskingControl ? . SelectionChanged ( ) ;
Original file line number Diff line number Diff line change 99using System . Collections . ObjectModel ;
1010using System . IO ;
1111using System . Linq ;
12+ using System . Threading . Tasks ;
1213using Windows . ApplicationModel . DataTransfer ;
1314using Windows . Storage ;
1415using Windows . UI . ViewManagement ;
@@ -36,7 +37,7 @@ public HorizontalMultitaskingControl()
3637 private const string TabDropHandledIdentifier = "FilesTabViewItemDropHandled" ;
3738 public ObservableCollection < TabItem > Items => MainPage . AppInstances ;
3839
39- public async void SetSelectedTabInfo ( string text , string currentPathForTabIcon )
40+ public async Task SetSelectedTabInfo ( string text , string currentPathForTabIcon )
4041 {
4142 var selectedTabItem = ( MainPage . AppInstances [ App . InteractionViewModel . TabStripSelectedIndex ] as TabItem ) ;
4243 selectedTabItem . AllowStorageItemDrop = App . CurrentInstance . InstanceViewModel . IsPageTypeNotHome ;
Original file line number Diff line number Diff line change 11using System . Collections . ObjectModel ;
2+ using System . Threading . Tasks ;
23
34namespace Files . UserControls . MultiTaskingControl
45{
56 public interface IMultitaskingControl
67 {
7- void SetSelectedTabInfo ( string text , string currentPathForTabIcon ) ;
8+ Task SetSelectedTabInfo ( string text , string currentPathForTabIcon ) ;
89
910 void SelectionChanged ( ) ;
1011
Original file line number Diff line number Diff line change 88using System . Collections . ObjectModel ;
99using System . IO ;
1010using System . Linq ;
11+ using System . Threading . Tasks ;
1112using Windows . ApplicationModel . DataTransfer ;
1213using Windows . Storage ;
1314using Windows . UI . Xaml ;
@@ -31,7 +32,7 @@ public VerticalTabView()
3132 this . InitializeComponent ( ) ;
3233 }
3334
34- public async void SetSelectedTabInfo ( string text , string currentPathForTabIcon = null )
35+ public async Task SetSelectedTabInfo ( string text , string currentPathForTabIcon = null )
3536 {
3637 var selectedTabItem = ( MainPage . AppInstances [ App . InteractionViewModel . TabStripSelectedIndex ] as TabItem ) ;
3738 selectedTabItem . AllowStorageItemDrop = App . CurrentInstance . InstanceViewModel . IsPageTypeNotHome ;
Original file line number Diff line number Diff line change @@ -541,7 +541,6 @@ public async void RapidAddItemsToCollectionAsync(string path)
541541 {
542542 App . CurrentInstance . NavigationToolbar . CanRefresh = false ;
543543
544- App . CurrentInstance . MultitaskingControl ? . SetSelectedTabInfo ( new DirectoryInfo ( path ) . Name , path ) ;
545544 CancelLoadAndClearFiles ( ) ;
546545
547546 try
You can’t perform that action at this time.
0 commit comments