diff --git a/src/Files.App/Helpers/FilePropertiesHelpers.cs b/src/Files.App/Helpers/FilePropertiesHelpers.cs index 64b6787abf38..1857e7d15940 100644 --- a/src/Files.App/Helpers/FilePropertiesHelpers.cs +++ b/src/Files.App/Helpers/FilePropertiesHelpers.cs @@ -11,7 +11,7 @@ using Windows.ApplicationModel; using Windows.Foundation.Metadata; using Windows.Graphics; -using static Files.App.Views.Properties; +using static Files.App.Views.Properties.MainPropertiesPage; namespace Files.App.Helpers { @@ -84,7 +84,7 @@ public static async Task OpenPropertiesWindowAsync(object item, IShellPage assoc appWindow.SetIcon(LogoPath); - if (frame.Content is Properties properties) + if (frame.Content is Views.Properties.MainPropertiesPage properties) properties.AppWindow = appWindow; appWindow.Show(); @@ -118,7 +118,7 @@ void Navigate(Frame frame) Item = item, AppInstanceArgument = associatedInstance, }; - frame.Navigate(typeof(Properties), argument, new SuppressNavigationTransitionInfo()); + frame.Navigate(typeof(Views.Properties.MainPropertiesPage), argument, new SuppressNavigationTransitionInfo()); } } diff --git a/src/Files.App/ViewModels/Properties/PropertiesTab.cs b/src/Files.App/ViewModels/Properties/BasePropertiesPage.cs similarity index 94% rename from src/Files.App/ViewModels/Properties/PropertiesTab.cs rename to src/Files.App/ViewModels/Properties/BasePropertiesPage.cs index 16e667ddae07..4a2b276f2d52 100644 --- a/src/Files.App/ViewModels/Properties/PropertiesTab.cs +++ b/src/Files.App/ViewModels/Properties/BasePropertiesPage.cs @@ -10,7 +10,7 @@ namespace Files.App.ViewModels.Properties { - public abstract class PropertiesTab : Page, IDisposable + public abstract class BasePropertiesPage : Page, IDisposable { public IShellPage AppInstance = null; @@ -28,7 +28,7 @@ protected virtual void Properties_Loaded(object sender, RoutedEventArgs e) protected override void OnNavigatedTo(NavigationEventArgs e) { - var np = e.Parameter as Views.Properties.PropertyNavParam; + var np = e.Parameter as Views.Properties.MainPropertiesPage.PropertyNavParam; AppInstance = np.AppInstanceArgument; ViewModel = new SelectedItemsPropertiesViewModel(); diff --git a/src/Files.App/ViewModels/Properties/CompatibilityProperties.cs b/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs similarity index 97% rename from src/Files.App/ViewModels/Properties/CompatibilityProperties.cs rename to src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs index 982fe93e1ea6..e6d2e984e4d3 100644 --- a/src/Files.App/ViewModels/Properties/CompatibilityProperties.cs +++ b/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs @@ -11,7 +11,7 @@ namespace Files.App.ViewModels.Properties { - public class CompatibilityProperties : ObservableObject + public class CompatibilityViewModel : ObservableObject { public ListedItem Item { get; } @@ -149,7 +149,7 @@ public LocalizedEnumHelper HighDpiOverride public IRelayCommand RunTroubleshooterCommand { get; set; } - public CompatibilityProperties(ListedItem item) + public CompatibilityViewModel(ListedItem item) { Item = item; diff --git a/src/Files.App/ViewModels/Properties/SecurityProperties.cs b/src/Files.App/ViewModels/Properties/SecurityViewModel.cs similarity index 98% rename from src/Files.App/ViewModels/Properties/SecurityProperties.cs rename to src/Files.App/ViewModels/Properties/SecurityViewModel.cs index 76980f2e083f..a6dee88bb2eb 100644 --- a/src/Files.App/ViewModels/Properties/SecurityProperties.cs +++ b/src/Files.App/ViewModels/Properties/SecurityViewModel.cs @@ -12,11 +12,11 @@ namespace Files.App.ViewModels.Properties { - public class SecurityProperties : ObservableObject + public class SecurityViewModel : ObservableObject { public ListedItem Item { get; } - public SecurityProperties(ListedItem item) + public SecurityViewModel(ListedItem item) { Item = item; @@ -25,7 +25,7 @@ public SecurityProperties(ListedItem item) InitCommands(); } - public SecurityProperties(DriveItem item) + public SecurityViewModel(DriveItem item) { Item = new ListedItem() { diff --git a/src/Files.App/Views/Pages/PropertiesCompatibility.xaml b/src/Files.App/Views/Properties/CompatibilityPage.xaml similarity index 97% rename from src/Files.App/Views/Pages/PropertiesCompatibility.xaml rename to src/Files.App/Views/Properties/CompatibilityPage.xaml index 092460c9155d..4f719363e4b3 100644 --- a/src/Files.App/Views/Pages/PropertiesCompatibility.xaml +++ b/src/Files.App/Views/Properties/CompatibilityPage.xaml @@ -1,5 +1,5 @@ - - + @@ -22,7 +22,7 @@ - + @@ -107,4 +107,4 @@ - + diff --git a/src/Files.App/Views/Pages/PropertiesCompatibility.xaml.cs b/src/Files.App/Views/Properties/CompatibilityPage.xaml.cs similarity index 70% rename from src/Files.App/Views/Pages/PropertiesCompatibility.xaml.cs rename to src/Files.App/Views/Properties/CompatibilityPage.xaml.cs index 062d4e947011..e4d60705aa7d 100644 --- a/src/Files.App/Views/Pages/PropertiesCompatibility.xaml.cs +++ b/src/Files.App/Views/Properties/CompatibilityPage.xaml.cs @@ -4,24 +4,24 @@ using Microsoft.UI.Xaml.Navigation; using System.Threading.Tasks; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesCompatibility : PropertiesTab + public sealed partial class CompatibilityPage : BasePropertiesPage { - public CompatibilityProperties CompatibilityProperties { get; set; } + public CompatibilityViewModel CompatibilityProperties { get; set; } - public PropertiesCompatibility() + public CompatibilityPage() { InitializeComponent(); } protected override void OnNavigatedTo(NavigationEventArgs e) { - var np = e.Parameter as Views.Properties.PropertyNavParam; + var np = e.Parameter as Views.Properties.MainPropertiesPage.PropertyNavParam; if (np.navParameter is ListedItem listedItem) { - CompatibilityProperties = new CompatibilityProperties(listedItem); + CompatibilityProperties = new CompatibilityViewModel(listedItem); } base.OnNavigatedTo(e); diff --git a/src/Files.App/Views/Pages/PropertiesCustomization.xaml b/src/Files.App/Views/Properties/CustomizationPage.xaml similarity index 95% rename from src/Files.App/Views/Pages/PropertiesCustomization.xaml rename to src/Files.App/Views/Properties/CustomizationPage.xaml index 9617c344c567..0d28b6fc54da 100644 --- a/src/Files.App/Views/Pages/PropertiesCustomization.xaml +++ b/src/Files.App/Views/Properties/CustomizationPage.xaml @@ -1,5 +1,5 @@ - - + @@ -22,7 +22,7 @@ - + @@ -125,4 +125,4 @@ - + diff --git a/src/Files.App/Views/Pages/PropertiesCustomization.xaml.cs b/src/Files.App/Views/Properties/CustomizationPage.xaml.cs similarity index 89% rename from src/Files.App/Views/Pages/PropertiesCustomization.xaml.cs rename to src/Files.App/Views/Properties/CustomizationPage.xaml.cs index 68c41b394191..49079dbd9df4 100644 --- a/src/Files.App/Views/Pages/PropertiesCustomization.xaml.cs +++ b/src/Files.App/Views/Properties/CustomizationPage.xaml.cs @@ -8,13 +8,13 @@ using System.IO; using System.Threading.Tasks; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesCustomization : PropertiesTab + public sealed partial class CustomizationPage : BasePropertiesPage { private CustomizationViewModel CustomizationViewModel { get; set; } - public PropertiesCustomization() + public CustomizationPage() { InitializeComponent(); } @@ -44,7 +44,7 @@ private async void PickDllButton_Click(object sender, RoutedEventArgs e) picker.FileTypeFilter.Add(".ico"); // WINUI3: Create and initialize new window - var parentWindowId = ((Properties)((Frame)XamlRoot.Content).Content).AppWindow.Id; + var parentWindowId = ((Views.Properties.MainPropertiesPage)((Frame)XamlRoot.Content).Content).AppWindow.Id; var handle = Microsoft.UI.Win32Interop.GetWindowFromWindowId(parentWindowId); WinRT.Interop.InitializeWithWindow.Initialize(picker, handle); diff --git a/src/Files.App/Views/Pages/PropertiesDetails.xaml b/src/Files.App/Views/Properties/DetailsPage.xaml similarity index 97% rename from src/Files.App/Views/Pages/PropertiesDetails.xaml rename to src/Files.App/Views/Properties/DetailsPage.xaml index 72062ad1fb6a..ab231537411e 100644 --- a/src/Files.App/Views/Pages/PropertiesDetails.xaml +++ b/src/Files.App/Views/Properties/DetailsPage.xaml @@ -1,5 +1,5 @@ - - + diff --git a/src/Files.App/Views/Pages/PropertiesDetails.xaml.cs b/src/Files.App/Views/Properties/DetailsPage.xaml.cs similarity index 94% rename from src/Files.App/Views/Pages/PropertiesDetails.xaml.cs rename to src/Files.App/Views/Properties/DetailsPage.xaml.cs index 62b03a925eea..0ad502bf710e 100644 --- a/src/Files.App/Views/Pages/PropertiesDetails.xaml.cs +++ b/src/Files.App/Views/Properties/DetailsPage.xaml.cs @@ -7,11 +7,11 @@ using System.Diagnostics; using System.Threading.Tasks; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesDetails : PropertiesTab + public sealed partial class DetailsPage : BasePropertiesPage { - public PropertiesDetails() + public DetailsPage() { InitializeComponent(); } diff --git a/src/Files.App/Views/Pages/PropertiesGeneral.xaml b/src/Files.App/Views/Properties/GeneralPage.xaml similarity index 99% rename from src/Files.App/Views/Pages/PropertiesGeneral.xaml rename to src/Files.App/Views/Properties/GeneralPage.xaml index 32fb54a9e259..97b04077a0d6 100644 --- a/src/Files.App/Views/Pages/PropertiesGeneral.xaml +++ b/src/Files.App/Views/Properties/GeneralPage.xaml @@ -1,5 +1,5 @@ - - + @@ -33,7 +33,7 @@ - + - + diff --git a/src/Files.App/Views/Pages/PropertiesGeneral.xaml.cs b/src/Files.App/Views/Properties/GeneralPage.xaml.cs similarity index 96% rename from src/Files.App/Views/Pages/PropertiesGeneral.xaml.cs rename to src/Files.App/Views/Properties/GeneralPage.xaml.cs index 804481fa876e..eeaa4783a521 100644 --- a/src/Files.App/Views/Pages/PropertiesGeneral.xaml.cs +++ b/src/Files.App/Views/Properties/GeneralPage.xaml.cs @@ -14,13 +14,13 @@ using System.Threading.Tasks; using Windows.Storage; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesGeneral : PropertiesTab + public sealed partial class GeneralPage : BasePropertiesPage { private readonly Regex letterRegex = new(@"\s*\(\w:\)$"); - public PropertiesGeneral() => InitializeComponent(); + public GeneralPage() => InitializeComponent(); public override async Task SaveChangesAsync() { diff --git a/src/Files.App/Views/Pages/PropertiesLibrary.xaml b/src/Files.App/Views/Properties/LibraryPage.xaml similarity index 95% rename from src/Files.App/Views/Pages/PropertiesLibrary.xaml rename to src/Files.App/Views/Properties/LibraryPage.xaml index fc8cb9cfea62..0a938ef5e4c9 100644 --- a/src/Files.App/Views/Pages/PropertiesLibrary.xaml +++ b/src/Files.App/Views/Properties/LibraryPage.xaml @@ -1,9 +1,10 @@ - - + @@ -134,4 +135,4 @@ - + diff --git a/src/Files.App/Views/Pages/PropertiesLibrary.xaml.cs b/src/Files.App/Views/Properties/LibraryPage.xaml.cs similarity index 97% rename from src/Files.App/Views/Pages/PropertiesLibrary.xaml.cs rename to src/Files.App/Views/Properties/LibraryPage.xaml.cs index abc0a4aa62de..6e506014638b 100644 --- a/src/Files.App/Views/Pages/PropertiesLibrary.xaml.cs +++ b/src/Files.App/Views/Properties/LibraryPage.xaml.cs @@ -15,9 +15,9 @@ using System.Windows.Input; using Windows.Storage.Pickers; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesLibrary : PropertiesTab, INotifyPropertyChanged + public sealed partial class LibraryPage : BasePropertiesPage, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; @@ -66,7 +66,7 @@ public bool IsPinned public ICommand SetDefaultLocationCommand { get; } public ICommand RemoveLocationCommand { get; } - public PropertiesLibrary() + public LibraryPage() { InitializeComponent(); diff --git a/src/Files.App/Views/Pages/Properties.xaml b/src/Files.App/Views/Properties/MainPropertiesPage.xaml similarity index 98% rename from src/Files.App/Views/Pages/Properties.xaml rename to src/Files.App/Views/Properties/MainPropertiesPage.xaml index acd095fac28c..552da656fa33 100644 --- a/src/Files.App/Views/Pages/Properties.xaml +++ b/src/Files.App/Views/Properties/MainPropertiesPage.xaml @@ -1,11 +1,11 @@  NavViewItems { get; set; } - public Properties() + public MainPropertiesPage() { InitializeComponent(); @@ -145,25 +145,25 @@ private void MainPropertiesWindowNavigationView_SelectionChanged(NavigationView switch ((PropertyNavigationViewItemEnums)args.SelectedItemContainer.Tag) { case PropertyNavigationViewItemEnums.ItemGeneral: - contentFrame.Navigate(typeof(PropertiesGeneral), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(GeneralPage), navParam, args.RecommendedNavigationTransitionInfo); break; case PropertyNavigationViewItemEnums.ItemShortcut: - contentFrame.Navigate(typeof(PropertiesShortcut), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(ShortcutPage), navParam, args.RecommendedNavigationTransitionInfo); break; case PropertyNavigationViewItemEnums.ItemLibrary: - contentFrame.Navigate(typeof(PropertiesLibrary), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(LibraryPage), navParam, args.RecommendedNavigationTransitionInfo); break; case PropertyNavigationViewItemEnums.ItemDetails: - contentFrame.Navigate(typeof(PropertiesDetails), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(DetailsPage), navParam, args.RecommendedNavigationTransitionInfo); break; case PropertyNavigationViewItemEnums.ItemSecurity: - contentFrame.Navigate(typeof(PropertiesSecurity), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(SecurityPage), navParam, args.RecommendedNavigationTransitionInfo); break; case PropertyNavigationViewItemEnums.ItemCustomization: - contentFrame.Navigate(typeof(PropertiesCustomization), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(CustomizationPage), navParam, args.RecommendedNavigationTransitionInfo); break; case PropertyNavigationViewItemEnums.ItemCompatibility: - contentFrame.Navigate(typeof(PropertiesCompatibility), navParam, args.RecommendedNavigationTransitionInfo); + contentFrame.Navigate(typeof(CompatibilityPage), navParam, args.RecommendedNavigationTransitionInfo); break; } } @@ -288,13 +288,13 @@ private async Task ApplyChanges() { if (contentFrame.Content is not null) { - if (contentFrame.Content is PropertiesGeneral propertiesGeneral) + if (contentFrame.Content is GeneralPage propertiesGeneral) { await propertiesGeneral.SaveChangesAsync(); } else { - await ((PropertiesTab)contentFrame.Content).SaveChangesAsync(); + await ((BasePropertiesPage)contentFrame.Content).SaveChangesAsync(); } } } diff --git a/src/Files.App/Views/Pages/PropertiesSecurityAdvanced.xaml b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml similarity index 99% rename from src/Files.App/Views/Pages/PropertiesSecurityAdvanced.xaml rename to src/Files.App/Views/Properties/SecurityAdvancedPage.xaml index a4e9e6a380f1..1b60ab7b7a06 100644 --- a/src/Files.App/Views/Pages/PropertiesSecurityAdvanced.xaml +++ b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml @@ -1,5 +1,5 @@  - /// Pagina vuota che può essere usata autonomamente oppure per l'esplorazione all'interno di un frame. - /// - public sealed partial class PropertiesSecurityAdvanced : Page + public sealed partial class SecurityAdvancedPage : Page { private object navParameterItem; public string DialogTitle => string.Format("SecurityAdvancedPermissionsTitle".GetLocalizedResource(), ViewModel.Item.Name); - public SecurityProperties ViewModel { get; set; } + public SecurityViewModel ViewModel { get; set; } public AppWindow appWindow; - public PropertiesSecurityAdvanced() + public SecurityAdvancedPage() { InitializeComponent(); @@ -59,11 +54,11 @@ protected override void OnNavigatedTo(NavigationEventArgs e) if (args.Item is ListedItem listedItem) { - ViewModel = new SecurityProperties(listedItem); + ViewModel = new SecurityViewModel(listedItem); } else if (args.Item is DriveItem driveitem) { - ViewModel = new SecurityProperties(driveitem); + ViewModel = new SecurityViewModel(driveitem); } base.OnNavigatedTo(e); diff --git a/src/Files.App/Views/Pages/PropertiesSecurity.xaml b/src/Files.App/Views/Properties/SecurityPage.xaml similarity index 99% rename from src/Files.App/Views/Pages/PropertiesSecurity.xaml rename to src/Files.App/Views/Properties/SecurityPage.xaml index c55bc082a3bc..0296c458c2e3 100644 --- a/src/Files.App/Views/Pages/PropertiesSecurity.xaml +++ b/src/Files.App/Views/Properties/SecurityPage.xaml @@ -1,5 +1,5 @@ - - + diff --git a/src/Files.App/Views/Pages/PropertiesSecurity.xaml.cs b/src/Files.App/Views/Properties/SecurityPage.xaml.cs similarity index 84% rename from src/Files.App/Views/Pages/PropertiesSecurity.xaml.cs rename to src/Files.App/Views/Properties/SecurityPage.xaml.cs index 63645288036d..ecfff47d4d1f 100644 --- a/src/Files.App/Views/Pages/PropertiesSecurity.xaml.cs +++ b/src/Files.App/Views/Properties/SecurityPage.xaml.cs @@ -14,19 +14,19 @@ using System.Threading.Tasks; using Windows.Foundation.Metadata; using Windows.Graphics; -using static Files.App.Views.PropertiesSecurityAdvanced; +using static Files.App.Views.Properties.SecurityAdvancedPage; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesSecurity : PropertiesTab + public sealed partial class SecurityPage : BasePropertiesPage { public RelayCommand OpenAdvancedPropertiesCommand { get; set; } - public SecurityProperties SecurityProperties { get; set; } + public SecurityViewModel SecurityProperties { get; set; } private AppWindow? propsView; - public PropertiesSecurity() + public SecurityPage() { InitializeComponent(); @@ -35,15 +35,15 @@ public PropertiesSecurity() protected override void OnNavigatedTo(NavigationEventArgs e) { - var np = e.Parameter as Views.Properties.PropertyNavParam; + var np = e.Parameter as Properties.MainPropertiesPage.PropertyNavParam; if (np.navParameter is ListedItem listedItem) { - SecurityProperties = new SecurityProperties(listedItem); + SecurityProperties = new SecurityViewModel(listedItem); } else if (np.navParameter is DriveItem driveitem) { - SecurityProperties = new SecurityProperties(driveitem); + SecurityProperties = new SecurityViewModel(driveitem); } base.OnNavigatedTo(e); @@ -82,7 +82,7 @@ private void OpenAdvancedProperties() { var frame = new Frame(); frame.RequestedTheme = ThemeHelper.RootTheme; - frame.Navigate(typeof(PropertiesSecurityAdvanced), new PropertiesPageNavigationArguments() + frame.Navigate(typeof(SecurityAdvancedPage), new PropertiesPageNavigationArguments() { Item = SecurityProperties.Item }, new SuppressNavigationTransitionInfo()); @@ -100,7 +100,7 @@ private void OpenAdvancedProperties() // Set content propertiesWindow.Content = frame; - if (frame.Content is PropertiesSecurityAdvanced properties) + if (frame.Content is SecurityAdvancedPage properties) properties.appWindow = appWindow; // Set min size diff --git a/src/Files.App/Views/Pages/PropertiesShortcut.xaml b/src/Files.App/Views/Properties/ShortcutPage.xaml similarity index 96% rename from src/Files.App/Views/Pages/PropertiesShortcut.xaml rename to src/Files.App/Views/Properties/ShortcutPage.xaml index a0a1fc20748b..1958915fe34d 100644 --- a/src/Files.App/Views/Pages/PropertiesShortcut.xaml +++ b/src/Files.App/Views/Properties/ShortcutPage.xaml @@ -1,5 +1,5 @@ - - + - + @@ -162,4 +162,4 @@ - + diff --git a/src/Files.App/Views/Pages/PropertiesShortcut.xaml.cs b/src/Files.App/Views/Properties/ShortcutPage.xaml.cs similarity index 86% rename from src/Files.App/Views/Pages/PropertiesShortcut.xaml.cs rename to src/Files.App/Views/Properties/ShortcutPage.xaml.cs index 1562e27c232b..b53452eef11d 100644 --- a/src/Files.App/Views/Pages/PropertiesShortcut.xaml.cs +++ b/src/Files.App/Views/Properties/ShortcutPage.xaml.cs @@ -4,11 +4,11 @@ using Files.App.ViewModels.Properties; using System.Threading.Tasks; -namespace Files.App.Views +namespace Files.App.Views.Properties { - public sealed partial class PropertiesShortcut : PropertiesTab + public sealed partial class ShortcutPage : BasePropertiesPage { - public PropertiesShortcut() + public ShortcutPage() { InitializeComponent(); }