diff --git a/src/Files.App/Styles/ToggleSwitchStyles.xaml b/src/Files.App/Styles/ToggleSwitchStyles.xaml deleted file mode 100644 index 2bd8e664a818..000000000000 --- a/src/Files.App/Styles/ToggleSwitchStyles.xaml +++ /dev/null @@ -1,591 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml b/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml deleted file mode 100644 index 60fe1161f57e..000000000000 --- a/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs b/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs deleted file mode 100644 index a8acd5430f38..000000000000 --- a/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Files Community -// Licensed under the MIT License. - -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Automation; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Markup; -using System; -using System.Windows.Input; - -namespace Files.App.UserControls.Settings -{ - [ContentProperty(Name = nameof(SettingsActionableElement))] - public sealed partial class SettingsBlockControl : UserControl - { - public FrameworkElement SettingsActionableElement { get; set; } - - public ICommand ButtonCommand - { - get { return (ICommand)GetValue(ButtonCommandProperty); } - set { SetValue(ButtonCommandProperty, value); } - } - public static readonly DependencyProperty ButtonCommandProperty = - DependencyProperty.Register("ButtonCommand", typeof(ICommand), typeof(SettingsBlockControl), new PropertyMetadata(null)); - - public static readonly DependencyProperty ExpandableContentProperty = DependencyProperty.Register( - "ExpandableContent", - typeof(FrameworkElement), - typeof(SettingsBlockControl), - new PropertyMetadata(null) - ); - - public FrameworkElement ExpandableContent - { - get => (FrameworkElement)GetValue(ExpandableContentProperty); - set => SetValue(ExpandableContentProperty, value); - } - - public static readonly DependencyProperty AdditionalDescriptionContentProperty = DependencyProperty.Register( - "AdditionalDescriptionContent", - typeof(FrameworkElement), - typeof(SettingsBlockControl), - new PropertyMetadata(null) - ); - - public FrameworkElement AdditionalDescriptionContent - { - get => (FrameworkElement)GetValue(AdditionalDescriptionContentProperty); - set => SetValue(AdditionalDescriptionContentProperty, value); - } - - public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( - "Title", - typeof(string), - typeof(SettingsBlockControl), - new PropertyMetadata(null) - ); - - public string Title - { - get => (string)GetValue(TitleProperty); - set => SetValue(TitleProperty, value); - } - - public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( - "Description", - typeof(string), - typeof(SettingsBlockControl), - new PropertyMetadata(null) - ); - - public string Description - { - get => (string)GetValue(DescriptionProperty); - set => SetValue(DescriptionProperty, value); - } - - public static readonly DependencyProperty IconProperty = DependencyProperty.Register( - "Icon", - typeof(IconElement), - typeof(SettingsBlockControl), - new PropertyMetadata(null) - ); - - public IconElement Icon - { - get => (IconElement)GetValue(IconProperty); - set => SetValue(IconProperty, value); - } - - public static readonly DependencyProperty IsClickableProperty = DependencyProperty.Register( - "IsClickable", - typeof(bool), - typeof(SettingsBlockControl), - new PropertyMetadata(false) - ); - - public bool IsClickable - { - get => (bool)GetValue(IsClickableProperty); - set => SetValue(IsClickableProperty, value); - } - - public static readonly DependencyProperty IsExpandedProperty = DependencyProperty.Register( - "IsExpanded", - typeof(bool), - typeof(SettingsBlockControl), - new PropertyMetadata(false) - ); - - public bool IsExpanded - { - get => (bool)GetValue(IsExpandedProperty); - set => SetValue(IsExpandedProperty, value); - } - - // - // Summary: - // Occurs when a button control is clicked. - public event EventHandler Click; - - public SettingsBlockControl() - { - InitializeComponent(); - Loaded += SettingsBlockControl_Loaded; - } - - private void SettingsBlockControl_Loaded(object sender, RoutedEventArgs e) - { - if (ActionableButton is not null) - { - AutomationProperties.SetName(ActionableButton, Title); - } - } - - private void Expander_Expanding(Microsoft.UI.Xaml.Controls.Expander sender, Microsoft.UI.Xaml.Controls.ExpanderExpandingEventArgs args) - { - Click?.Invoke(this, true); - } - - private void Expander_Collapsed(Microsoft.UI.Xaml.Controls.Expander sender, Microsoft.UI.Xaml.Controls.ExpanderCollapsedEventArgs args) - { - Click?.Invoke(this, false); - } - } -} \ No newline at end of file diff --git a/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml b/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml deleted file mode 100644 index 55e2ffbf156f..000000000000 --- a/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs b/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs deleted file mode 100644 index baae0d6a2918..000000000000 --- a/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Files Community -// Licensed under the MIT License. - -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Markup; - -namespace Files.App.UserControls.Settings -{ - [ContentProperty(Name = nameof(SettingsActionableElement))] - public sealed partial class SettingsDisplayControl : UserControl - { - public FrameworkElement SettingsActionableElement { get; set; } - - public static readonly DependencyProperty AdditionalDescriptionContentProperty = DependencyProperty.Register( - "AdditionalDescriptionContent", - typeof(FrameworkElement), - typeof(SettingsDisplayControl), - new PropertyMetadata(null) - ); - - public FrameworkElement AdditionalDescriptionContent - { - get => (FrameworkElement)GetValue(AdditionalDescriptionContentProperty); - set => SetValue(AdditionalDescriptionContentProperty, value); - } - - public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( - "Title", - typeof(string), - typeof(SettingsDisplayControl), - new PropertyMetadata(null) - ); - - public string Title - { - get => (string)GetValue(TitleProperty); - set => SetValue(TitleProperty, value); - } - - public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( - "Description", - typeof(string), - typeof(SettingsDisplayControl), - new PropertyMetadata(null) - ); - - public string Description - { - get => (string)GetValue(DescriptionProperty); - set => SetValue(DescriptionProperty, value); - } - - public static readonly DependencyProperty IconProperty = DependencyProperty.Register( - "Icon", - typeof(IconElement), - typeof(SettingsDisplayControl), - new PropertyMetadata(null) - ); - - public IconElement Icon - { - get => (IconElement)GetValue(IconProperty); - set => SetValue(IconProperty, value); - } - - public SettingsDisplayControl() - { - InitializeComponent(); - VisualStateManager.GoToState(this, "NormalState", false); - } - - private void MainPanel_SizeChanged(object sender, SizeChangedEventArgs e) - { - if (e.NewSize.Width == e.PreviousSize.Width || ActionableElement is null) - return; - - var stateToGoName = (ActionableElement.ActualWidth > e.NewSize.Width / 3) ? "CompactState" : "NormalState"; - VisualStateManager.GoToState(this, stateToGoName, false); - } - } -} diff --git a/src/Files.App/UserControls/Toolbar.xaml b/src/Files.App/UserControls/Toolbar.xaml index c87db143ba69..190ee63d0e80 100644 --- a/src/Files.App/UserControls/Toolbar.xaml +++ b/src/Files.App/UserControls/Toolbar.xaml @@ -18,7 +18,6 @@ - @@ -1176,11 +1175,11 @@ @@ -1193,12 +1192,12 @@ @@ -1214,13 +1213,13 @@ x:Name="AdaptiveLayoutToggleSwitch" Grid.Row="2" Grid.Column="1" + MinWidth="68" HorizontalAlignment="Right" x:Load="{x:Bind Commands.LayoutAdaptive.IsExecutable, Mode=OneWay}" AutomationProperties.Name="{x:Bind Commands.LayoutAdaptive.AutomationName}" IsEnabled="{x:Bind Commands.LayoutAdaptive.IsExecutable, Mode=OneWay}" IsOn="{x:Bind Commands.LayoutAdaptive.IsOn, Mode=TwoWay}" Rotation="1" - Style="{StaticResource RightAlignedToggleSwitchStyle}" ToolTipService.ToolTip="{x:Bind Commands.LayoutAdaptive.LabelWithHotKey, Mode=OneWay}" /> diff --git a/src/Files.App/Views/Properties/CompatibilityPage.xaml b/src/Files.App/Views/Properties/CompatibilityPage.xaml index a0825ff2d107..6d05ba1fb3c6 100644 --- a/src/Files.App/Views/Properties/CompatibilityPage.xaml +++ b/src/Files.App/Views/Properties/CompatibilityPage.xaml @@ -7,8 +7,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:settingsuc="using:Files.App.UserControls.Settings" xmlns:vm="using:Files.App.ViewModels.Properties" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" DataContext="{x:Bind CompatibilityViewModel, Mode=OneWay}" Loaded="Properties_Loaded" Tag="Compatibility" @@ -18,7 +18,6 @@ - @@ -30,79 +29,66 @@ - - - + + + + + - + - + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - + - + - + - + diff --git a/src/Files.App/Views/Properties/GeneralPage.xaml b/src/Files.App/Views/Properties/GeneralPage.xaml index 6449a1ce6135..3199eab76b19 100644 --- a/src/Files.App/Views/Properties/GeneralPage.xaml +++ b/src/Files.App/Views/Properties/GeneralPage.xaml @@ -3,7 +3,6 @@ x:Class="Files.App.Views.Properties.GeneralPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:Files.App.UserControls.Settings" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" @@ -11,6 +10,7 @@ xmlns:toolkitconverters="using:CommunityToolkit.WinUI.Converters" xmlns:uc="using:Files.App.UserControls" xmlns:vm="using:Files.App.ViewModels.Properties" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" Loaded="Properties_Loaded" Tag="General" mc:Ignorable="d"> @@ -592,34 +592,28 @@ - - - - - + Command="{x:Bind ViewModel.CleanupDriveCommand}" + Header="{helpers:ResourceString Name=CleanupDrive}" + IsClickEnabled="True"> + + + + - - - - - + Command="{x:Bind ViewModel.FormatDriveCommand}" + Header="{helpers:ResourceString Name=FormatDrive}" + IsClickEnabled="True"> + + + + @@ -16,7 +16,6 @@ - @@ -137,38 +136,32 @@ Text="{x:Bind ViewModel.ShortcutItemWorkingDirEditedValue, Mode=TwoWay}" /> - + x:Load="{x:Bind ViewModel.ShortcutItemWindowArgsVisibility, Mode=OneWay}" + Header="{helpers:ResourceString Name=StartWindow}"> - + - - - - - + + + + - - + Command="{x:Bind ViewModel.ShortcutItemOpenLinkCommand, Mode=OneWay}" + Header="{helpers:ResourceString Name=OpenFileLocation}" + IsClickEnabled="True"> + + + + diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index 39e05652e85b..52a8b3eb841e 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -7,9 +7,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dataitems="using:Files.App.Data.Items" xmlns:helpers="using:Files.App.Helpers" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:Files.App.ViewModels.Settings" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" mc:Ignorable="d"> @@ -30,13 +30,13 @@ Text="{helpers:ResourceString Name=About}" /> - - + Description="{x:Bind ViewModel.Version}" + Header="{x:Bind ViewModel.AppName}"> + - + - + - - + + - + - - + + + + @@ -72,86 +71,79 @@ Text="{helpers:ResourceString Name=HelpAndSupport}" /> - - + Command="{x:Bind ViewModel.OpenDocumentationCommand}" + Header="{helpers:ResourceString Name=Documentation}" + IsClickEnabled="True"> + - + - - + + + + - - + Command="{x:Bind ViewModel.OpenDiscordCommand}" + Header="{helpers:ResourceString Name=QuestionsAndDiscussions}" + IsClickEnabled="True"> + - + - - + + + + - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + Command="{x:Bind ViewModel.OpenLogLocationCommand}" + Header="{helpers:ResourceString Name=OpenLogLocation}" + IsClickEnabled="True"> + - + - - + + + + @@ -162,81 +154,80 @@ Text="{helpers:ResourceString Name=OpenSource}" /> - - + Command="{x:Bind ViewModel.OpenCrowdinCommand}" + Header="{helpers:ResourceString Name=ImproveTranslation}" + IsClickEnabled="True"> + - + - - + + + + - - + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + Command="{x:Bind ViewModel.OpenGitHubRepoCommand}" + Header="{helpers:ResourceString Name=OpenGitHubRepo}" + IsClickEnabled="True"> + - + - - + + + + - - + Command="{x:Bind ViewModel.OpenPrivacyPolicyCommand}" + Header="{helpers:ResourceString Name=Privacy}" + IsClickEnabled="True"> + - + - - + + + + diff --git a/src/Files.App/Views/Settings/ActionsPage.xaml b/src/Files.App/Views/Settings/ActionsPage.xaml index aa6fce8cf1e1..e825bc04a3de 100644 --- a/src/Files.App/Views/Settings/ActionsPage.xaml +++ b/src/Files.App/Views/Settings/ActionsPage.xaml @@ -35,7 +35,6 @@ - diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml b/src/Files.App/Views/Settings/AdvancedPage.xaml index 6ce39465bae0..d4ac08f65966 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml @@ -7,17 +7,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:Files.App.ViewModels.Settings" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" mc:Ignorable="d"> - - - - @@ -40,46 +36,43 @@ Text="{helpers:ResourceString Name=Advanced}" /> - - + + - - - + + + + + - - + + - - - + + + + + - - + + - - - + + + + + @@ -94,45 +87,38 @@ Severity="Warning" /> - - + + - + + IsOn="{x:Bind ViewModel.OpenOnWindowsStartup, Mode=TwoWay}"> - + - - + + - - - + + + - - + + - - - + + + - - + Header="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}"> + - - + + - + - - + x:Load="{x:Bind ViewModel.IsAppEnvironmentDev}" + Header="{helpers:ResourceString Name=SettingsSetAsOpenDialog}"> + - - + + - + - - + Description="{helpers:ResourceString Name=ShowFlattenOptionsDescription}" + Header="{helpers:ResourceString Name=ShowFlattenOptions}"> + - - - + + + diff --git a/src/Files.App/Views/Settings/AppearancePage.xaml b/src/Files.App/Views/Settings/AppearancePage.xaml index bf9620caeaef..0561f329eab0 100644 --- a/src/Files.App/Views/Settings/AppearancePage.xaml +++ b/src/Files.App/Views/Settings/AppearancePage.xaml @@ -7,20 +7,15 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dataitem="using:Files.App.Data.Items" xmlns:helpers="using:Files.App.Helpers" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:toolkit="using:CommunityToolkit.WinUI.Controls" xmlns:uc="using:Files.App.UserControls" xmlns:vm="using:Files.App.ViewModels.Settings" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" mc:Ignorable="d"> - - - - @@ -100,36 +95,36 @@ Text="{helpers:ResourceString Name=Appearance}" /> - - + + - + - + - - + + - + - + - - + - + - + - - + + - - + - + - - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + - - + + - + - + IsOn="{x:Bind ViewModel.ShowTabActions, Mode=TwoWay}" /> + - - + + - + - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + diff --git a/src/Files.App/Views/Settings/DevToolsPage.xaml b/src/Files.App/Views/Settings/DevToolsPage.xaml index 5f7c7b610e7e..cff891ea3ba5 100644 --- a/src/Files.App/Views/Settings/DevToolsPage.xaml +++ b/src/Files.App/Views/Settings/DevToolsPage.xaml @@ -7,19 +7,15 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:uc="using:Files.App.UserControls" xmlns:vm="using:Files.App.ViewModels.Settings" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" mc:Ignorable="d"> - - - - - - + + - + - + - - + + - - + x:Load="{x:Bind ViewModel.IsLogoutEnabled, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" + Header="{helpers:ResourceString Name=ConnectToGitHub}"> + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + AllowDrop="True" + CanReorderItems="True" + IsItemClickEnabled="False" + ItemsSource="{x:Bind ViewModel.PagesOnStartupList, Mode=TwoWay}" + SelectedIndex="{x:Bind ViewModel.SelectedPageIndex, Mode=TwoWay}" + SelectionMode="None"> + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - + + + + + + + + - - + + - + - + IsOn="{x:Bind ViewModel.AlwaysSwitchToNewlyOpenedTab, Mode=TwoWay}" /> + - - + + - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - - - + + + + + @@ -271,115 +239,80 @@ Text="{helpers:ResourceString Name=SettingsContextMenu/Text}" /> - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /> + --> - - - - + + + + - - - - - - - + + + + + + - - + + - - - + + + diff --git a/src/Files.App/Views/Settings/LayoutPage.xaml b/src/Files.App/Views/Settings/LayoutPage.xaml index 69bcda648f96..901832a9e3e7 100644 --- a/src/Files.App/Views/Settings/LayoutPage.xaml +++ b/src/Files.App/Views/Settings/LayoutPage.xaml @@ -6,19 +6,15 @@ xmlns:converters="using:CommunityToolkit.WinUI.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:uc="using:Files.App.UserControls" xmlns:vm="using:Files.App.ViewModels.Settings" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" mc:Ignorable="d"> - - - - @@ -40,26 +36,22 @@ Text="{helpers:ResourceString Name=Layout}" /> - - + + - + - + IsOn="{x:Bind ViewModel.SyncFolderPreferencesAcrossDirectories, Mode=TwoWay}" /> + - - + + - + @@ -69,7 +61,7 @@ - + - - + + - + @@ -92,33 +84,28 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - + @@ -129,31 +116,28 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/Views/Settings/TagsPage.xaml b/src/Files.App/Views/Settings/TagsPage.xaml index 40738893ceb4..b192238045e8 100644 --- a/src/Files.App/Views/Settings/TagsPage.xaml +++ b/src/Files.App/Views/Settings/TagsPage.xaml @@ -8,9 +8,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:datamodels="using:Files.App.Data.Models" xmlns:helpers="using:Files.App.Helpers" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:Files.App.ViewModels.Settings" + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" mc:Ignorable="d"> @@ -47,16 +47,13 @@ Text="{helpers:ResourceString Name=FileTags}" /> - - + + - +