File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
src/Files.App/Views/Properties Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 15
15
using Microsoft . UI . Xaml . Input ;
16
16
using Microsoft . UI . Xaml . Navigation ;
17
17
using System ;
18
+ using System . Collections . Generic ;
18
19
using System . Collections . ObjectModel ;
20
+ using System . Linq ;
19
21
using System . Threading ;
20
22
using System . Threading . Tasks ;
21
23
using Windows . Foundation . Metadata ;
@@ -231,8 +233,21 @@ private void AddNavigationViewItemsToControl(object item)
231
233
232
234
MainPropertiesWindowNavigationView . SelectedItem = generalItem ;
233
235
234
- // Unable unavailable property tabs
235
- if ( item is ListedItem listedItem )
236
+ if ( item is List < ListedItem > listedItems )
237
+ {
238
+ var commonFileExt = listedItems . Select ( x => x . FileExtension ) . Distinct ( ) . Count ( ) == 1 ? listedItems . First ( ) . FileExtension : null ;
239
+ var compatibilityItemEnabled = listedItems . All ( listedItem => FileExtensionHelpers . IsExecutableFile ( listedItem is ShortcutItem sht ? sht . TargetPath : commonFileExt , true ) ) ;
240
+
241
+ if ( ! compatibilityItemEnabled )
242
+ NavViewItems . Remove ( compatibilityItem ) ;
243
+
244
+ NavViewItems . Remove ( libraryItem ) ;
245
+ NavViewItems . Remove ( shortcutItem ) ;
246
+ NavViewItems . Remove ( detailsItem ) ;
247
+ NavViewItems . Remove ( securityItem ) ;
248
+ NavViewItems . Remove ( customizationItem ) ;
249
+ }
250
+ else if ( item is ListedItem listedItem )
236
251
{
237
252
var isShortcut = listedItem . IsShortcut ;
238
253
var isLibrary = listedItem . IsLibrary ;
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ public SecurityPage()
30
30
{
31
31
InitializeComponent ( ) ;
32
32
33
- OpenAdvancedPropertiesCommand = new RelayCommand ( ( ) => OpenAdvancedProperties ( ) ) ;
33
+ OpenAdvancedPropertiesCommand = new RelayCommand ( OpenAdvancedProperties ) ;
34
34
}
35
35
36
36
protected override void OnNavigatedTo ( NavigationEventArgs e )
37
37
{
38
- var np = e . Parameter as Properties . MainPropertiesPage . PropertyNavParam ;
38
+ var np = e . Parameter as MainPropertiesPage . PropertyNavParam ;
39
39
40
40
if ( np . navParameter is ListedItem listedItem )
41
41
{
You can’t perform that action at this time.
0 commit comments