22using Files . Filesystem ;
33using Microsoft . Toolkit . Uwp . UI . Controls ;
44using System ;
5- using System . Collections ;
65using System . Collections . Generic ;
76using System . Collections . ObjectModel ;
87using System . Diagnostics ;
3231using Windows . UI . Xaml . Hosting ;
3332using Windows . UI . WindowManagement . Preview ;
3433using Windows . UI ;
35- using Files . View_Models ;
36- using System . Security . Cryptography ;
3734using Windows . Security . Cryptography . Core ;
3835using Microsoft . Toolkit . Uwp . Helpers ;
3936using Windows . Security . Cryptography ;
@@ -111,11 +108,22 @@ public async void OpenDirectoryInNewTab_Click(object sender, RoutedEventArgs e)
111108 var items = ( CurrentInstance . ContentPage as BaseLayout ) . SelectedItems ;
112109 foreach ( ListedItem listedItem in items )
113110 {
114- await CoreWindow . GetForCurrentThread ( ) . Dispatcher . RunAsync ( CoreDispatcherPriority . Low , ( ) =>
111+ await CoreWindow . GetForCurrentThread ( ) . Dispatcher . RunAsync ( CoreDispatcherPriority . Low , ( ) =>
115112 {
116113 instanceTabsView . AddNewTab ( typeof ( ModernShellPage ) , listedItem . ItemPath ) ;
117114 } ) ;
118115 }
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 ) ;
119127 }
120128
121129 public async void OpenDirectoryInTerminal ( object sender , RoutedEventArgs e )
@@ -254,7 +262,7 @@ public void AllView_RightTapped(object sender, RightTappedRoutedEventArgs e)
254262 if ( App . CurrentInstance . ContentPage . SelectedItems . Contains ( ObjectPressed ) )
255263 return ;
256264 }
257-
265+
258266 // The following code is only reachable when a user RightTapped an unselected row
259267 dataGrid . SelectedItems . Clear ( ) ;
260268 dataGrid . SelectedItems . Add ( ObjectPressed ) ;
@@ -436,17 +444,32 @@ public async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
436444 {
437445 AppWindow appWindow = await AppWindow . TryCreateAsync ( ) ;
438446 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+ }
439461 frame . Navigate ( typeof ( Properties ) , null , new SuppressNavigationTransitionInfo ( ) ) ;
440462 WindowManagementPreview . SetPreferredMinSize ( appWindow , new Size ( 400 , 475 ) ) ;
463+
441464 appWindow . RequestSize ( new Size ( 400 , 475 ) ) ;
442- appWindow . Title = "Properties" ;
465+ appWindow . Title = ResourceController . GetTranslation ( "PropertiesTitle" ) ;
443466
444467 ElementCompositionPreview . SetAppWindowContent ( appWindow , frame ) ;
445468 AppWindows . Add ( frame . UIContext , appWindow ) ;
446469
447470 appWindow . Closed += delegate
448471 {
449- Interaction . AppWindows . Remove ( frame . UIContext ) ;
472+ AppWindows . Remove ( frame . UIContext ) ;
450473 frame . Content = null ;
451474 appWindow = null ;
452475 } ;
@@ -470,7 +493,7 @@ public async void ShowFolderPropertiesButton_Click(object sender, RoutedEventArg
470493 frame . Navigate ( typeof ( Properties ) , null , new SuppressNavigationTransitionInfo ( ) ) ;
471494 WindowManagementPreview . SetPreferredMinSize ( appWindow , new Size ( 400 , 475 ) ) ;
472495 appWindow . RequestSize ( new Size ( 400 , 475 ) ) ;
473- appWindow . Title = "Properties" ;
496+ appWindow . Title = ResourceController . GetTranslation ( "PropertiesTitle" ) ;
474497
475498 ElementCompositionPreview . SetAppWindowContent ( appWindow , frame ) ;
476499 AppWindows . Add ( frame . UIContext , appWindow ) ;
@@ -643,7 +666,7 @@ public async void DeleteItem_Click(object sender, RoutedEventArgs e)
643666 catch ( FileNotFoundException )
644667 {
645668 Debug . WriteLine ( "Attention: Tried to delete an item that could be found" ) ;
646- }
669+ }
647670
648671 App . InteractionViewModel . PermanentlyDelete = false ; //reset PermanentlyDelete flag
649672 }
@@ -686,7 +709,7 @@ public async Task<bool> RenameFileItem(ListedItem item, string oldName, string n
686709 }
687710
688711 catch ( Exception )
689-
712+
690713 {
691714 var dialog = new ContentDialog ( )
692715 {
@@ -730,7 +753,7 @@ public async Task<bool> RenameFileItem(ListedItem item, string oldName, string n
730753 }
731754 }
732755 }
733-
756+
734757 CurrentInstance . NavigationToolbar . CanGoForward = false ;
735758 return true ;
736759 }
@@ -772,7 +795,8 @@ public async void CutItem_Click(object sender, RoutedEventArgs e)
772795 if ( App . CurrentInstance . CurrentPageType == typeof ( GenericFileBrowser ) )
773796 {
774797 ( 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 ) )
776800 {
777801 GridViewItem itemToDimForCut = ( GridViewItem ) ( CurrentInstance . ContentPage as PhotoAlbum ) . FileList . ContainerFromItem ( listedItem ) ;
778802 List < Grid > itemContentGrids = new List < Grid > ( ) ;
@@ -934,7 +958,7 @@ public async Task PasteItems(DataPackageView packageView, string destinationPath
934958
935959 if ( acceptedOperation == DataPackageOperation . Move )
936960 {
937- foreach ( IStorageItem item in pastedItems )
961+ foreach ( IStorageItem item in itemsToPaste )
938962 {
939963 if ( item . IsOfType ( StorageItemTypes . File ) )
940964 {
@@ -970,7 +994,7 @@ public async Task<StorageFolder> CloneDirectoryAsync(string SourcePath, string D
970994
971995 foreach ( StorageFile fileInSourceDir in await SourceFolder . GetFilesAsync ( ) )
972996 {
973- if ( itemsToPaste != null )
997+ if ( itemsToPaste != null )
974998 {
975999 if ( itemsToPaste . Count > 3 && ! suppressProgressFlyout )
9761000 {
0 commit comments