2
2
using Files . Filesystem ;
3
3
using Microsoft . Toolkit . Uwp . UI . Controls ;
4
4
using System ;
5
- using System . Collections ;
6
5
using System . Collections . Generic ;
7
6
using System . Collections . ObjectModel ;
8
7
using System . Diagnostics ;
32
31
using Windows . UI . Xaml . Hosting ;
33
32
using Windows . UI . WindowManagement . Preview ;
34
33
using Windows . UI ;
35
- using Files . View_Models ;
36
- using System . Security . Cryptography ;
37
34
using Windows . Security . Cryptography . Core ;
38
35
using Microsoft . Toolkit . Uwp . Helpers ;
39
36
using Windows . Security . Cryptography ;
@@ -111,11 +108,22 @@ public async void OpenDirectoryInNewTab_Click(object sender, RoutedEventArgs e)
111
108
var items = ( CurrentInstance . ContentPage as BaseLayout ) . SelectedItems ;
112
109
foreach ( ListedItem listedItem in items )
113
110
{
114
- await CoreWindow . GetForCurrentThread ( ) . Dispatcher . RunAsync ( CoreDispatcherPriority . Low , ( ) =>
111
+ await CoreWindow . GetForCurrentThread ( ) . Dispatcher . RunAsync ( CoreDispatcherPriority . Low , ( ) =>
115
112
{
116
113
instanceTabsView . AddNewTab ( typeof ( ModernShellPage ) , listedItem . ItemPath ) ;
117
114
} ) ;
118
115
}
116
+ }
117
+
118
+ public void OpenPathInNewTab ( string path )
119
+ {
120
+ instanceTabsView . AddNewTab ( typeof ( ModernShellPage ) , path ) ;
121
+ }
122
+
123
+ public async void OpenPathInNewWindow ( string path )
124
+ {
125
+ var folderUri = new Uri ( "files-uwp:" + "?folder=" + path ) ;
126
+ await Launcher . LaunchUriAsync ( folderUri ) ;
119
127
}
120
128
121
129
public async void OpenDirectoryInTerminal ( object sender , RoutedEventArgs e )
@@ -254,7 +262,7 @@ public void AllView_RightTapped(object sender, RightTappedRoutedEventArgs e)
254
262
if ( App . CurrentInstance . ContentPage . SelectedItems . Contains ( ObjectPressed ) )
255
263
return ;
256
264
}
257
-
265
+
258
266
// The following code is only reachable when a user RightTapped an unselected row
259
267
dataGrid . SelectedItems . Clear ( ) ;
260
268
dataGrid . SelectedItems . Add ( ObjectPressed ) ;
@@ -436,17 +444,32 @@ public async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
436
444
{
437
445
AppWindow appWindow = await AppWindow . TryCreateAsync ( ) ;
438
446
Frame frame = new Frame ( ) ;
447
+ appWindow . TitleBar . ExtendsContentIntoTitleBar = true ;
448
+ var titleBar = appWindow . TitleBar ;
449
+ titleBar . ButtonBackgroundColor = Colors . Transparent ;
450
+ titleBar . ButtonInactiveBackgroundColor = Colors . Transparent ;
451
+ var selectedTheme = Application . Current . RequestedTheme ;
452
+ if ( selectedTheme == ApplicationTheme . Light )
453
+ {
454
+ titleBar . ButtonForegroundColor = Color . FromArgb ( 255 , 0 , 0 , 0 ) ;
455
+ titleBar . ButtonHoverBackgroundColor = Color . FromArgb ( 20 , 0 , 0 , 0 ) ;
456
+ }
457
+ else if ( selectedTheme == ApplicationTheme . Dark )
458
+ {
459
+ titleBar . ButtonHoverBackgroundColor = Color . FromArgb ( 40 , 255 , 255 , 255 ) ;
460
+ }
439
461
frame . Navigate ( typeof ( Properties ) , null , new SuppressNavigationTransitionInfo ( ) ) ;
440
462
WindowManagementPreview . SetPreferredMinSize ( appWindow , new Size ( 400 , 475 ) ) ;
463
+
441
464
appWindow . RequestSize ( new Size ( 400 , 475 ) ) ;
442
- appWindow . Title = "Properties" ;
465
+ appWindow . Title = ResourceController . GetTranslation ( "PropertiesTitle" ) ;
443
466
444
467
ElementCompositionPreview . SetAppWindowContent ( appWindow , frame ) ;
445
468
AppWindows . Add ( frame . UIContext , appWindow ) ;
446
469
447
470
appWindow . Closed += delegate
448
471
{
449
- Interaction . AppWindows . Remove ( frame . UIContext ) ;
472
+ AppWindows . Remove ( frame . UIContext ) ;
450
473
frame . Content = null ;
451
474
appWindow = null ;
452
475
} ;
@@ -470,7 +493,7 @@ public async void ShowFolderPropertiesButton_Click(object sender, RoutedEventArg
470
493
frame . Navigate ( typeof ( Properties ) , null , new SuppressNavigationTransitionInfo ( ) ) ;
471
494
WindowManagementPreview . SetPreferredMinSize ( appWindow , new Size ( 400 , 475 ) ) ;
472
495
appWindow . RequestSize ( new Size ( 400 , 475 ) ) ;
473
- appWindow . Title = "Properties" ;
496
+ appWindow . Title = ResourceController . GetTranslation ( "PropertiesTitle" ) ;
474
497
475
498
ElementCompositionPreview . SetAppWindowContent ( appWindow , frame ) ;
476
499
AppWindows . Add ( frame . UIContext , appWindow ) ;
@@ -643,7 +666,7 @@ public async void DeleteItem_Click(object sender, RoutedEventArgs e)
643
666
catch ( FileNotFoundException )
644
667
{
645
668
Debug . WriteLine ( "Attention: Tried to delete an item that could be found" ) ;
646
- }
669
+ }
647
670
648
671
App . InteractionViewModel . PermanentlyDelete = false ; //reset PermanentlyDelete flag
649
672
}
@@ -686,7 +709,7 @@ public async Task<bool> RenameFileItem(ListedItem item, string oldName, string n
686
709
}
687
710
688
711
catch ( Exception )
689
-
712
+
690
713
{
691
714
var dialog = new ContentDialog ( )
692
715
{
@@ -730,7 +753,7 @@ public async Task<bool> RenameFileItem(ListedItem item, string oldName, string n
730
753
}
731
754
}
732
755
}
733
-
756
+
734
757
CurrentInstance . NavigationToolbar . CanGoForward = false ;
735
758
return true ;
736
759
}
@@ -772,7 +795,8 @@ public async void CutItem_Click(object sender, RoutedEventArgs e)
772
795
if ( App . CurrentInstance . CurrentPageType == typeof ( GenericFileBrowser ) )
773
796
{
774
797
( CurrentInstance . ContentPage as GenericFileBrowser ) . AllView . Columns [ 0 ] . GetCellContent ( listedItem ) . Opacity = 0.4 ;
775
- } else if ( App . CurrentInstance . CurrentPageType == typeof ( PhotoAlbum ) )
798
+ }
799
+ else if ( App . CurrentInstance . CurrentPageType == typeof ( PhotoAlbum ) )
776
800
{
777
801
GridViewItem itemToDimForCut = ( GridViewItem ) ( CurrentInstance . ContentPage as PhotoAlbum ) . FileList . ContainerFromItem ( listedItem ) ;
778
802
List < Grid > itemContentGrids = new List < Grid > ( ) ;
@@ -934,7 +958,7 @@ public async Task PasteItems(DataPackageView packageView, string destinationPath
934
958
935
959
if ( acceptedOperation == DataPackageOperation . Move )
936
960
{
937
- foreach ( IStorageItem item in pastedItems )
961
+ foreach ( IStorageItem item in itemsToPaste )
938
962
{
939
963
if ( item . IsOfType ( StorageItemTypes . File ) )
940
964
{
@@ -970,7 +994,7 @@ public async Task<StorageFolder> CloneDirectoryAsync(string SourcePath, string D
970
994
971
995
foreach ( StorageFile fileInSourceDir in await SourceFolder . GetFilesAsync ( ) )
972
996
{
973
- if ( itemsToPaste != null )
997
+ if ( itemsToPaste != null )
974
998
{
975
999
if ( itemsToPaste . Count > 3 && ! suppressProgressFlyout )
976
1000
{
0 commit comments