@@ -16,6 +16,7 @@ public PropertiesGeneral()
16
16
{
17
17
this . InitializeComponent ( ) ;
18
18
}
19
+
19
20
public override async Task < bool > SaveChangesAsync ( ListedItem item )
20
21
{
21
22
if ( BaseProperties is DriveProperties driveProps )
@@ -54,7 +55,7 @@ public override async Task<bool> SaveChangesAsync(ListedItem item)
54
55
if ( AppInstance . FilesystemViewModel != null && App . LibraryManager . CanCreateLibrary ( newName ) . result )
55
56
{
56
57
var libraryPath = library . ItemPath ;
57
- var renamed = await AppInstance . FilesystemHelpers . RenameAsync ( new StorageFileWithPath ( null , libraryPath ) , newName , Windows . Storage . NameCollisionOption . FailIfExists , false ) ;
58
+ var renamed = await AppInstance . FilesystemHelpers . RenameAsync ( new StorageFileWithPath ( null , libraryPath ) , $ " { newName } { ShellLibraryItem . EXTENSION } " , Windows . Storage . NameCollisionOption . FailIfExists , false ) ;
58
59
if ( renamed == Enums . ReturnResult . Success )
59
60
{
60
61
var newPath = Path . Combine ( Path . GetDirectoryName ( libraryPath ) , $ "{ newName } { ShellLibraryItem . EXTENSION } ") ;
@@ -67,38 +68,34 @@ public override async Task<bool> SaveChangesAsync(ListedItem item)
67
68
}
68
69
}
69
70
}
71
+ else if ( BaseProperties is CombinedProperties combinedProps )
72
+ {
73
+ // Handle the visibility attribute for multiple files
74
+ if ( AppInstance ? . SlimContentPage ? . ItemManipulationModel != null ) // null on homepage
75
+ {
76
+ foreach ( var fileOrFolder in combinedProps . List )
77
+ {
78
+ await CoreApplication . MainView . DispatcherQueue . EnqueueAsync ( ( ) => UIFilesystemHelpers . SetHiddenAttributeItem ( fileOrFolder , ViewModel . IsHidden , AppInstance . SlimContentPage . ItemManipulationModel ) ) ;
79
+ }
80
+ }
81
+ return true ;
82
+ }
70
83
else
71
84
{
85
+ // Handle the visibility attribute for a single file
86
+ if ( AppInstance ? . SlimContentPage ? . ItemManipulationModel != null ) // null on homepage
87
+ {
88
+ await CoreApplication . MainView . DispatcherQueue . EnqueueAsync ( ( ) => UIFilesystemHelpers . SetHiddenAttributeItem ( item , ViewModel . IsHidden , AppInstance . SlimContentPage . ItemManipulationModel ) ) ;
89
+ }
90
+
72
91
ViewModel . ItemName = ItemFileName . Text ; // Make sure ItemName is updated
73
92
if ( ! string . IsNullOrWhiteSpace ( ViewModel . ItemName ) && ViewModel . OriginalItemName != ViewModel . ItemName )
74
93
{
75
94
return await CoreApplication . MainView . DispatcherQueue . EnqueueAsync ( ( ) => UIFilesystemHelpers . RenameFileItemAsync ( item ,
76
95
ViewModel . ItemName ,
77
96
AppInstance ) ) ;
78
97
}
79
-
80
- // Handle the hidden attribute
81
- if ( BaseProperties is CombinedProperties combinedProps )
82
- {
83
- // Handle each file independently
84
- if ( AppInstance ? . SlimContentPage ? . ItemManipulationModel != null ) // null on homepage
85
- {
86
- foreach ( var fileOrFolder in combinedProps . List )
87
- {
88
- await CoreApplication . MainView . DispatcherQueue . EnqueueAsync ( ( ) => UIFilesystemHelpers . SetHiddenAttributeItem ( fileOrFolder , ViewModel . IsHidden , AppInstance . SlimContentPage . ItemManipulationModel ) ) ;
89
- }
90
- }
91
- return true ;
92
- }
93
- else
94
- {
95
- // Handle the visibility attribute for a single file
96
- if ( AppInstance ? . SlimContentPage ? . ItemManipulationModel != null ) // null on homepage
97
- {
98
- await CoreApplication . MainView . DispatcherQueue . EnqueueAsync ( ( ) => UIFilesystemHelpers . SetHiddenAttributeItem ( item , ViewModel . IsHidden , AppInstance . SlimContentPage . ItemManipulationModel ) ) ;
99
- }
100
- return true ;
101
- }
98
+ return true ;
102
99
}
103
100
104
101
return false ;
0 commit comments