Files
SpdUp/ViewModels/SettingsViewModel.cs
T
Phil-icyou 19ba425e79 Initial commit: SpdUp Windows Gaming Booster v1.0.0
- .NET 8 WPF app with full MVVM architecture
- One-click boost: CPU, RAM, GPU, network, services, timer resolution
- Real-time system monitor (LibreHardwareMonitor)
- Auto game detection (30+ games)
- RAM optimizer with kernel-level cleanup
- Network optimizer (TCP registry tweaks)
- Service manager, process manager, shader cache cleaner
- Desktop widget overlay
- Debug log viewer
- Custom dark gaming theme with trans pride colors
- 84 unit tests (xUnit)
- Inno Setup installer script
- Landing page website
2026-03-08 17:34:45 +01:00

92 lines
2.4 KiB
C#

using System.Windows.Input;
using SpdUp.Core;
using SpdUp.Models;
namespace SpdUp.ViewModels;
/// <summary>
/// Settings page ViewModel.
/// </summary>
public sealed class SettingsViewModel : ObservableObject
{
private readonly AppSettings _settings;
private readonly MainViewModel _main;
public bool AutoDetectGames
{
get => _settings.AutoDetectGames;
set { _settings.AutoDetectGames = value; OnPropertyChanged(); Save(); }
}
public bool AutoBoostOnGameLaunch
{
get => _settings.AutoBoostOnGameLaunch;
set { _settings.AutoBoostOnGameLaunch = value; OnPropertyChanged(); Save(); }
}
public bool MinimizeToTray
{
get => _settings.MinimizeToTray;
set { _settings.MinimizeToTray = value; OnPropertyChanged(); Save(); }
}
public bool StartWithWindows
{
get => _settings.StartWithWindows;
set { _settings.StartWithWindows = value; OnPropertyChanged(); Save(); }
}
public bool WidgetCompactMode
{
get => _settings.WidgetCompactMode;
set { _settings.WidgetCompactMode = value; OnPropertyChanged(); Save(); }
}
public double WidgetOpacity
{
get => _settings.WidgetOpacity;
set { _settings.WidgetOpacity = value; OnPropertyChanged(); Save(); }
}
public int WidgetUpdateInterval
{
get => _settings.WidgetUpdateIntervalMs;
set { _settings.WidgetUpdateIntervalMs = value; OnPropertyChanged(); Save(); }
}
public bool WidgetClickThrough
{
get => _settings.WidgetClickThrough;
set { _settings.WidgetClickThrough = value; OnPropertyChanged(); Save(); }
}
public int MonitoringInterval
{
get => _settings.MonitoringIntervalMs;
set { _settings.MonitoringIntervalMs = value; OnPropertyChanged(); Save(); }
}
public string PingTarget
{
get => _settings.PingTarget;
set { _settings.PingTarget = value; OnPropertyChanged(); Save(); }
}
public string PreferredDns
{
get => _settings.PreferredDns;
set { _settings.PreferredDns = value; OnPropertyChanged(); Save(); }
}
public ICommand SaveCommand { get; }
public SettingsViewModel(AppSettings settings, MainViewModel main)
{
_settings = settings;
_main = main;
SaveCommand = new RelayCommand(Save);
}
private void Save() => _settings.Save();
}