整理控件库

This commit is contained in:
GG Z
2025-05-05 17:04:06 +08:00
parent 74532b77be
commit 3eaad7566e
283 changed files with 2156 additions and 17846 deletions

View File

@@ -12,7 +12,7 @@ using WPFluent.Extensions;
namespace WPFluent.Gallery.ViewModels.Pages;
public sealed partial class SettingsViewModel(INavigationService navigationService) : ViewModel
public sealed partial class SettingsViewModel() : ViewModel
{
private bool _isInitialized = false;
@@ -20,11 +20,7 @@ public sealed partial class SettingsViewModel(INavigationService navigationServi
private string _appVersion = string.Empty;
[ObservableProperty]
private ApplicationTheme _currentApplicationTheme = ApplicationTheme.Unknown;
[ObservableProperty]
private NavigationViewPaneDisplayMode _currentApplicationNavigationStyle =
NavigationViewPaneDisplayMode.Left;
private ThemeType _currentApplicationTheme = ThemeType.Unknow;
public override void OnNavigatedTo()
{
@@ -34,30 +30,23 @@ public sealed partial class SettingsViewModel(INavigationService navigationServi
}
}
partial void OnCurrentApplicationThemeChanged(ApplicationTheme oldValue, ApplicationTheme newValue)
partial void OnCurrentApplicationThemeChanged(ThemeType oldValue, ThemeType newValue)
{
ApplicationThemeManager.Apply(newValue);
ThemeManager.ChangeAppTheme(newValue);
}
partial void OnCurrentApplicationNavigationStyleChanged(
NavigationViewPaneDisplayMode oldValue,
NavigationViewPaneDisplayMode newValue
)
{
_ = navigationService.SetPaneDisplayMode(newValue);
}
private void InitializeViewModel()
{
CurrentApplicationTheme = ApplicationThemeManager.GetAppTheme();
CurrentApplicationTheme = ThemeManager.GetAppTheme();
AppVersion = $"{GetAssemblyVersion()}";
ApplicationThemeManager.Changed += OnThemeChanged;
ThemeManager.Changed += OnThemeChanged;
_isInitialized = true;
}
private void OnThemeChanged(ApplicationTheme currentApplicationTheme, Color systemAccent)
private void OnThemeChanged(ThemeType currentApplicationTheme, Color systemAccent)
{
// Update the theme if it has been changed elsewhere than in the settings.
if (CurrentApplicationTheme != currentApplicationTheme)