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)
221
221
await App . CurrentInstance . FilesystemViewModel . SetWorkingDirectory ( parameters ) ;
222
222
223
223
// 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 )
226
227
{
227
228
App . CurrentInstance . NavigationToolbar . CanNavigateToParent = false ;
228
229
}
229
230
else
230
231
{
231
232
App . CurrentInstance . NavigationToolbar . CanNavigateToParent = true ;
232
233
}
234
+
233
235
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 ( "\\ \\ ?\\ " ) ;
238
238
239
+ await App . CurrentInstance . MultitaskingControl ? . SetSelectedTabInfo ( new DirectoryInfo ( workingDir ) . Name , workingDir ) ;
239
240
App . CurrentInstance . FilesystemViewModel . RefreshItems ( ) ;
240
241
241
242
App . CurrentInstance . MultitaskingControl ? . SelectionChanged ( ) ;
Original file line number Diff line number Diff line change 9
9
using System . Collections . ObjectModel ;
10
10
using System . IO ;
11
11
using System . Linq ;
12
+ using System . Threading . Tasks ;
12
13
using Windows . ApplicationModel . DataTransfer ;
13
14
using Windows . Storage ;
14
15
using Windows . UI . ViewManagement ;
@@ -36,7 +37,7 @@ public HorizontalMultitaskingControl()
36
37
private const string TabDropHandledIdentifier = "FilesTabViewItemDropHandled" ;
37
38
public ObservableCollection < TabItem > Items => MainPage . AppInstances ;
38
39
39
- public async void SetSelectedTabInfo ( string text , string currentPathForTabIcon )
40
+ public async Task SetSelectedTabInfo ( string text , string currentPathForTabIcon )
40
41
{
41
42
var selectedTabItem = ( MainPage . AppInstances [ App . InteractionViewModel . TabStripSelectedIndex ] as TabItem ) ;
42
43
selectedTabItem . AllowStorageItemDrop = App . CurrentInstance . InstanceViewModel . IsPageTypeNotHome ;
Original file line number Diff line number Diff line change 1
1
using System . Collections . ObjectModel ;
2
+ using System . Threading . Tasks ;
2
3
3
4
namespace Files . UserControls . MultiTaskingControl
4
5
{
5
6
public interface IMultitaskingControl
6
7
{
7
- void SetSelectedTabInfo ( string text , string currentPathForTabIcon ) ;
8
+ Task SetSelectedTabInfo ( string text , string currentPathForTabIcon ) ;
8
9
9
10
void SelectionChanged ( ) ;
10
11
Original file line number Diff line number Diff line change 8
8
using System . Collections . ObjectModel ;
9
9
using System . IO ;
10
10
using System . Linq ;
11
+ using System . Threading . Tasks ;
11
12
using Windows . ApplicationModel . DataTransfer ;
12
13
using Windows . Storage ;
13
14
using Windows . UI . Xaml ;
@@ -31,7 +32,7 @@ public VerticalTabView()
31
32
this . InitializeComponent ( ) ;
32
33
}
33
34
34
- public async void SetSelectedTabInfo ( string text , string currentPathForTabIcon = null )
35
+ public async Task SetSelectedTabInfo ( string text , string currentPathForTabIcon = null )
35
36
{
36
37
var selectedTabItem = ( MainPage . AppInstances [ App . InteractionViewModel . TabStripSelectedIndex ] as TabItem ) ;
37
38
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)
541
541
{
542
542
App . CurrentInstance . NavigationToolbar . CanRefresh = false ;
543
543
544
- App . CurrentInstance . MultitaskingControl ? . SetSelectedTabInfo ( new DirectoryInfo ( path ) . Name , path ) ;
545
544
CancelLoadAndClearFiles ( ) ;
546
545
547
546
try
You can’t perform that action at this time.
0 commit comments