Free, open-source Windows optimization tool for performance, privacy, and simplicity.
C# csharpdebloatdotnetgamingopen-sourceoptimizationoptimizeroptimizerduckperformanceprivacytweakertweakswindowswinui
feat: Introduce Startup Manager feature with dedicated service, models, and UI, and refactor common converter namespaces.
fatDuckcf08929dfb39
diff --git a/optimizerDuck/App.xaml.cs b/optimizerDuck/App.xaml.csindex 6f9de62..83defc2 100644--- a/optimizerDuck/App.xaml.cs+++ b/optimizerDuck/App.xaml.cs@@ -161,6 +161,9 @@ public partial class App : Applicationservices.AddSingleton<DiskCleanupViewModel>();services.AddSingleton<DiskCleanupPage>();+ services.AddSingleton<StartupManagerViewModel>();+ services.AddSingleton<StartupManagerPage>();+// Optimizationsservices.AddAllOptimizationPages();@@ -173,6 +176,7 @@ public partial class App : Applicationservices.AddSingleton<OptimizationService>();services.AddSingleton<BloatwareService>();services.AddSingleton<DiskCleanupService>();+ services.AddSingleton<StartupManagerService>();services.AddSingleton<SystemInfoService>();services.AddSingleton<StreamService>();services.AddSingleton<UpdaterService>();diff --git a/optimizerDuck/Common/Converters/BooleanToVisibilityConverter.cs b/optimizerDuck/Common/Converters/BooleanToVisibilityConverter.csindex 35e2cac..d3bba4c 100644--- a/optimizerDuck/Common/Converters/BooleanToVisibilityConverter.cs+++ b/optimizerDuck/Common/Converters/BooleanToVisibilityConverter.cs@@ -1,7 +1,7 @@using optimizerDuck.Common.Converters;using System.Windows;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public sealed class BooleanToVisibilityConverter(): BooleanConverter<Visibility>(Visibility.Visible, Visibility.Collapsed);\ No newline at end of filediff --git a/optimizerDuck/Common/Converters/EmptyWhileNotLoadingConverter.cs b/optimizerDuck/Common/Converters/EmptyWhileNotLoadingConverter.csindex 2d8448c..0ad64d0 100644--- a/optimizerDuck/Common/Converters/EmptyWhileNotLoadingConverter.cs+++ b/optimizerDuck/Common/Converters/EmptyWhileNotLoadingConverter.cs@@ -2,7 +2,7 @@ using System.Globalization;using System.Windows;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class EmptyWhileNotLoadingConverter : IMultiValueConverter{@@ -22,4 +22,4 @@ public class EmptyWhileNotLoadingConverter : IMultiValueConverterpublic object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)=> throw new NotSupportedException();-}+}\ No newline at end of filediff --git a/optimizerDuck/Common/Converters/GreaterThanNumberToVisibilityConverter.cs b/optimizerDuck/Common/Converters/GreaterThanNumberToVisibilityConverter.csindex e3db0d0..58ffdec 100644--- a/optimizerDuck/Common/Converters/GreaterThanNumberToVisibilityConverter.cs+++ b/optimizerDuck/Common/Converters/GreaterThanNumberToVisibilityConverter.cs@@ -2,7 +2,7 @@ using System.Globalization;using System.Windows;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class GreaterThanNumberToVisibilityConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/GreaterThanZeroToVisibilityConverter.cs b/optimizerDuck/Common/Converters/GreaterThanZeroToVisibilityConverter.csindex be85b93..7a21a28 100644--- a/optimizerDuck/Common/Converters/GreaterThanZeroToVisibilityConverter.cs+++ b/optimizerDuck/Common/Converters/GreaterThanZeroToVisibilityConverter.cs@@ -2,7 +2,7 @@ using System.Globalization;using System.Windows;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class GreaterThanZeroToVisibilityConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/InverseBooleanConverter.cs b/optimizerDuck/Common/Converters/InverseBooleanConverter.csindex 156354c..8fe5ecc 100644--- a/optimizerDuck/Common/Converters/InverseBooleanConverter.cs+++ b/optimizerDuck/Common/Converters/InverseBooleanConverter.cs@@ -1,7 +1,7 @@using System.Globalization;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class InverseBooleanConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/MBToGBConverter.cs b/optimizerDuck/Common/Converters/MBToGBConverter.csindex 968951c..c1858c7 100644--- a/optimizerDuck/Common/Converters/MBToGBConverter.cs+++ b/optimizerDuck/Common/Converters/MBToGBConverter.cs@@ -1,7 +1,7 @@using System.Globalization;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class MBToGBConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/MinusNumberConverter.cs b/optimizerDuck/Common/Converters/MinusNumberConverter.csindex ac2ca1a..63566e2 100644--- a/optimizerDuck/Common/Converters/MinusNumberConverter.cs+++ b/optimizerDuck/Common/Converters/MinusNumberConverter.cs@@ -1,7 +1,7 @@using System.Globalization;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class MinusNumberConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/NullToVisibilityConverter.cs b/optimizerDuck/Common/Converters/NullToVisibilityConverter.csindex 0063e24..edc900c 100644--- a/optimizerDuck/Common/Converters/NullToVisibilityConverter.cs+++ b/optimizerDuck/Common/Converters/NullToVisibilityConverter.cs@@ -2,7 +2,7 @@ using System.Globalization;using System.Windows;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class NullToVisibilityConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/SizeToBrushConverter.cs b/optimizerDuck/Common/Converters/SizeToBrushConverter.csindex 924e5ed..00f8b1c 100644--- a/optimizerDuck/Common/Converters/SizeToBrushConverter.cs+++ b/optimizerDuck/Common/Converters/SizeToBrushConverter.cs@@ -1,8 +1,9 @@+using optimizerDuck.Common.Helpers;using System.Globalization;using System.Windows.Data;using System.Windows.Media;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;/// <summary>/// Converts a byte size (long) to a color brush:diff --git a/optimizerDuck/Common/Converters/ThemeToGitHubIconConverter.cs b/optimizerDuck/Common/Converters/ThemeToGitHubIconConverter.csindex 7be3a21..b4e29eb 100644--- a/optimizerDuck/Common/Converters/ThemeToGitHubIconConverter.cs+++ b/optimizerDuck/Common/Converters/ThemeToGitHubIconConverter.cs@@ -3,7 +3,7 @@ using System.Windows.Data;using System.Windows.Media.Imaging;using Wpf.Ui.Appearance;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public sealed class ThemeToGitHubIconConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/ThemeToIndexConverter.cs b/optimizerDuck/Common/Converters/ThemeToIndexConverter.csindex d79e325..f018804 100644--- a/optimizerDuck/Common/Converters/ThemeToIndexConverter.cs+++ b/optimizerDuck/Common/Converters/ThemeToIndexConverter.cs@@ -2,7 +2,7 @@ using System.Globalization;using System.Windows.Data;using Wpf.Ui.Appearance;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public sealed class ThemeToIndexConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/WidthToColumnConverter.cs b/optimizerDuck/Common/Converters/WidthToColumnConverter.csindex 5752007..650565a 100644--- a/optimizerDuck/Common/Converters/WidthToColumnConverter.cs+++ b/optimizerDuck/Common/Converters/WidthToColumnConverter.cs@@ -1,7 +1,7 @@using System.Globalization;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class WidthToColumnConverter : IValueConverter{diff --git a/optimizerDuck/Common/Converters/ZeroToVisibilityConverter.cs b/optimizerDuck/Common/Converters/ZeroToVisibilityConverter.csindex a93c8db..e2bb964 100644--- a/optimizerDuck/Common/Converters/ZeroToVisibilityConverter.cs+++ b/optimizerDuck/Common/Converters/ZeroToVisibilityConverter.cs@@ -2,7 +2,7 @@ using System.Globalization;using System.Windows;using System.Windows.Data;-namespace optimizerDuck.Common.Helpers.Converters;+namespace optimizerDuck.Common.Converters;public class ZeroToVisibilityConverter : IValueConverter{diff --git a/optimizerDuck/Core/Models/Bloatware/AppXPackage.cs b/optimizerDuck/Core/Models/Bloatware/AppXPackage.csindex 365a532..d785d58 100644--- a/optimizerDuck/Core/Models/Bloatware/AppXPackage.cs+++ b/optimizerDuck/Core/Models/Bloatware/AppXPackage.cs@@ -16,6 +16,7 @@ public partial class AppXPackage : ObservableObject{[ObservableProperty] private bool _isSelected;+ public string? LogoImage { get; set; }public required string Name { get; init; }public required string PackageFullName { get; init; }public required string Publisher { get; init; }diff --git a/optimizerDuck/Core/Models/StartupManager/StartupApp.cs b/optimizerDuck/Core/Models/StartupManager/StartupApp.csnew file mode 100644index 0000000..751a671--- /dev/null+++ b/optimizerDuck/Core/Models/StartupManager/StartupApp.cs@@ -0,0 +1,38 @@+using System.Windows.Media;+using CommunityToolkit.Mvvm.ComponentModel;++namespace optimizerDuck.Core.Models.StartupManager;++public enum StartupAppLocation+{+ RegistryHKCURun,+ RegistryHKLMRun,+ RegistryHKCURunOnce,+ RegistryHKLMRunOnce,+ UserStartupFolder,+ CommonStartupFolder+}++public partial class StartupApp : ObservableObject+{+ [ObservableProperty] private bool _isEnabled;++ public ImageSource? LogoImage { get; set; }+ public required string Name { get; init; }+ public required string Publisher { get; init; }+ public required string Command { get; init; }+ public required StartupAppLocation Location { get; init; }+ public required string PathOrKey { get; init; }+ public required string OriginalValueNameOrFileName { get; init; }++ public string LocationDisplay => Location switch+ {+ StartupAppLocation.RegistryHKCURun => "Registry (Current User)",+ StartupAppLocation.RegistryHKLMRun => "Registry (Local Machine)",+ StartupAppLocation.RegistryHKCURunOnce => "Registry RunOnce (Current User)",+ StartupAppLocation.RegistryHKLMRunOnce => "Registry RunOnce (Local Machine)",+ StartupAppLocation.UserStartupFolder => "Startup Folder (Current User)",+ StartupAppLocation.CommonStartupFolder => "Startup Folder (All Users)",+ _ => PathOrKey+ };+}diff --git a/optimizerDuck/Core/Models/StartupManager/StartupTask.cs b/optimizerDuck/Core/Models/StartupManager/StartupTask.csnew file mode 100644index 0000000..faedbca--- /dev/null+++ b/optimizerDuck/Core/Models/StartupManager/StartupTask.cs@@ -0,0 +1,12 @@+using CommunityToolkit.Mvvm.ComponentModel;++namespace optimizerDuck.Core.Models.StartupManager;++public partial class StartupTask : ObservableObject+{+ [ObservableProperty] private bool _isEnabled;++ public required string TaskName { get; init; }+ public required string TaskPath { get; init; }+ public string? Description { get; init; }+}diff --git a/optimizerDuck/Resources/Languages/Translations.Designer.cs b/optimizerDuck/Resources/Languages/Translations.Designer.csindex bebc6d3..dc79bd6 100644--- a/optimizerDuck/Resources/Languages/Translations.Designer.cs+++ b/optimizerDuck/Resources/Languages/Translations.Designer.cs@@ -411,24 +411,6 @@ namespace optimizerDuck.Resources.Languages {}}- /// <summary>- /// Looks up a localized string similar to Source.- /// </summary>- public static string Common_SortBy_Source {- get {- return ResourceManager.GetString("Common.SortBy.Source", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Status.- /// </summary>- public static string Common_SortBy_Status {- get {- return ResourceManager.GetString("Common.SortBy.Status", resourceCulture);- }- }-/// <summary>/// Looks up a localized string similar to Unknown./// </summary>@@ -3118,61 +3100,16 @@ namespace optimizerDuck.Resources.Languages {}/// <summary>- /// Looks up a localized string similar to No programs are configured to run at startup..- /// </summary>- public static string StartupManager_Empty_Description {- get {- return ResourceManager.GetString("StartupManager.Empty.Description", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to No startup items found.- /// </summary>- public static string StartupManager_Empty_Title {- get {- return ResourceManager.GetString("StartupManager.Empty.Title", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to All Sources.- /// </summary>- public static string StartupManager_Filter_All {- get {- return ResourceManager.GetString("StartupManager.Filter.All", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Startup Folder.- /// </summary>- public static string StartupManager_Filter_Folder {- get {- return ResourceManager.GetString("StartupManager.Filter.Folder", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Registry.+ /// Looks up a localized string similar to Startup Apps./// </summary>- public static string StartupManager_Filter_Registry {+ public static string StartupManager_Apps_Title {get {- return ResourceManager.GetString("StartupManager.Filter.Registry", resourceCulture);+ return ResourceManager.GetString("StartupManager.Apps.Title", resourceCulture);}}/// <summary>- /// Looks up a localized string similar to Scheduled Task.- /// </summary>- public static string StartupManager_Filter_ScheduledTask {- get {- return ResourceManager.GetString("StartupManager.Filter.ScheduledTask", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Manage programs that run automatically when you log in.+ /// Looks up a localized string similar to Manage applications and tasks that run automatically when Windows starts../// </summary>public static string StartupManager_Header_Description {get {@@ -3190,74 +3127,11 @@ namespace optimizerDuck.Resources.Languages {}/// <summary>- /// Looks up a localized string similar to Scanning startup entries….- /// </summary>- public static string StartupManager_Loading {- get {- return ResourceManager.GetString("StartupManager.Loading", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Refresh.- /// </summary>- public static string StartupManager_Menu_Refresh {- get {- return ResourceManager.GetString("StartupManager.Menu.Refresh", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to No results found. Try a different search term or filter..- /// </summary>- public static string StartupManager_Search_NoResults {- get {- return ResourceManager.GetString("StartupManager.Search.NoResults", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Startup Folder.- /// </summary>- public static string StartupManager_Source_Folder {- get {- return ResourceManager.GetString("StartupManager.Source.Folder", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Registry.- /// </summary>- public static string StartupManager_Source_Registry {- get {- return ResourceManager.GetString("StartupManager.Source.Registry", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Scheduled Task.- /// </summary>- public static string StartupManager_Source_ScheduledTask {- get {- return ResourceManager.GetString("StartupManager.Source.ScheduledTask", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to An error occurred: {0}.- /// </summary>- public static string StartupManager_Toggle_Error_Message {- get {- return ResourceManager.GetString("StartupManager.Toggle.Error.Message", resourceCulture);- }- }-- /// <summary>- /// Looks up a localized string similar to Couldn't toggle startup entry.+ /// Looks up a localized string similar to Scheduled Tasks (Logon)./// </summary>- public static string StartupManager_Toggle_Error_Title {+ public static string StartupManager_Tasks_Title {get {- return ResourceManager.GetString("StartupManager.Toggle.Error.Title", resourceCulture);+ return ResourceManager.GetString("StartupManager.Tasks.Title", resourceCulture);}}}diff --git a/optimizerDuck/Resources/Languages/Translations.resx b/optimizerDuck/Resources/Languages/Translations.resxindex 6878d14..0ee1738 100644--- a/optimizerDuck/Resources/Languages/Translations.resx+++ b/optimizerDuck/Resources/Languages/Translations.resx@@ -1129,4 +1129,34 @@ Update now to enjoy the latest features, improvements, and bug fixes.</value><data name="Settings.About.Author.Description" xml:space="preserve"><value>hi, i'm the creator of this app. i love cats.</value></data>+ <data name="Sidebar.StartupManager" xml:space="preserve">+ <value>Startup Manager</value>+ </data>+ <data name="StartupManager.Header.Title" xml:space="preserve">+ <value>Startup Manager</value>+ </data>+ <data name="StartupManager.Header.Description" xml:space="preserve">+ <value>Manage applications and tasks that run automatically when Windows starts.</value>+ </data>+ <data name="StartupManager.Apps.Title" xml:space="preserve">+ <value>Startup Apps</value>+ </data>+ <data name="StartupManager.Tasks.Title" xml:space="preserve">+ <value>Scheduled Tasks (Logon)</value>+ </data>+ <data name="StartupManager.Loading" xml:space="preserve">+ <value>Scanning startup items...</value>+ </data>+ <data name="StartupManager.Loading.Hint" xml:space="preserve">+ <value>This may take a moment while we scan the registry and startup folders.</value>+ </data>+ <data name="StartupManager.Empty.Title" xml:space="preserve">+ <value>No startup items</value>+ </data>+ <data name="StartupManager.Empty.Description" xml:space="preserve">+ <value>No startup applications or scheduled tasks were found on this system.</value>+ </data>+ <data name="StartupManager.Menu.Refresh" xml:space="preserve">+ <value>Refresh</value>+ </data></root>\ No newline at end of filediff --git a/optimizerDuck/Resources/Languages/Translations.vi-VN.resx b/optimizerDuck/Resources/Languages/Translations.vi-VN.resxindex 6d5ac09..c097d54 100644--- a/optimizerDuck/Resources/Languages/Translations.vi-VN.resx+++ b/optimizerDuck/Resources/Languages/Translations.vi-VN.resx@@ -1129,4 +1129,34 @@ Cập nhật ngay để trải nghiệm các tính năng mới, cải tiến và<data name="Settings.About.Author.Description" xml:space="preserve"><value>hi, tôi là người tạo ra ứng dụng này. tôi yêu mèo.</value></data>+ <data name="Sidebar.StartupManager" xml:space="preserve">+ <value>Quản Lý Khởi Động</value>+ </data>+ <data name="StartupManager.Header.Title" xml:space="preserve">+ <value>Quản Lý Khởi Động</value>+ </data>+ <data name="StartupManager.Header.Description" xml:space="preserve">+ <value>Quản lý các ứng dụng và tác vụ tự động chạy khi Windows khởi động</value>+ </data>+ <data name="StartupManager.Apps.Title" xml:space="preserve">+ <value>Ứng dụng Khởi động</value>+ </data>+ <data name="StartupManager.Tasks.Title" xml:space="preserve">+ <value>Tác vụ Lên lịch (Logon)</value>+ </data>+ <data name="StartupManager.Loading" xml:space="preserve">+ <value>Đang quét các mục khởi động...</value>+ </data>+ <data name="StartupManager.Loading.Hint" xml:space="preserve">+ <value>Quá trình này có thể mất một lúc khi quét registry và thư mục khởi động.</value>+ </data>+ <data name="StartupManager.Empty.Title" xml:space="preserve">+ <value>Không có mục khởi động</value>+ </data>+ <data name="StartupManager.Empty.Description" xml:space="preserve">+ <value>Không tìm thấy ứng dụng hoặc tác vụ khởi động nào trên hệ thống này.</value>+ </data>+ <data name="StartupManager.Menu.Refresh" xml:space="preserve">+ <value>Làm mới</value>+ </data></root>\ No newline at end of filediff --git a/optimizerDuck/Services/BloatwareService.cs b/optimizerDuck/Services/BloatwareService.csindex 6d7561b..edf48b0 100644--- a/optimizerDuck/Services/BloatwareService.cs+++ b/optimizerDuck/Services/BloatwareService.cs@@ -1,14 +1,15 @@using Microsoft.Extensions.Logging;using Microsoft.Extensions.Options;using optimizerDuck.Common.Helpers;-using optimizerDuck.Common.Helpers.Converters;using optimizerDuck.Core.Models.Bloatware;using optimizerDuck.Core.Models.Config;using optimizerDuck.Services.OptimizationServices;+using System.IO;+using System.Linq;using System.Text.Json;using System.Text.Json.Serialization;-using System.Linq;using System.Text.RegularExpressions;+using System.Xml.Linq;using JsonSerializer = System.Text.Json.JsonSerializer;namespace optimizerDuck.Services;@@ -26,8 +27,14 @@ public class BloatwareService(ILogger<BloatwareService> logger, IOptionsMonitor<$safeRegex = '{{safePattern}}'$cautionRegex = '{{cautionPattern}}'- Get-AppxPackage | Where-Object { $_.NonRemovable -eq $false } | ForEach-Object {+ Get-AppxPackage |+ Where-Object {+ $_.NonRemovable -eq $false -and+ $_.IsFramework -eq $false+ } |+ ForEach-Object {$risk = "Unknown"+if ($_.Name -match $safeRegex) { $risk = "Safe" }elseif ($_.Name -match $cautionRegex) { $risk = "Caution" }@@ -51,6 +58,26 @@ public class BloatwareService(ILogger<BloatwareService> logger, IOptionsMonitor<var apps = JsonSerializer.Deserialize<List<AppXPackage>>(result.Stdout, options)!.OrderBy(a => a.Name).ToList();+ foreach (var app in apps)+ {+ if (string.IsNullOrWhiteSpace(app.InstallLocation))+ continue;++ try+ {+ var manifestLogo = ResolveLogo(app.InstallLocation);+ if (manifestLogo != null)+ {+ app.LogoImage = manifestLogo;+ continue;+ }+ }+ catch+ {+ /* Ignore access exceptions */+ }+ }+logger.LogInformation("Found {AppCount} AppX packages", apps.Count);return apps;@@ -142,4 +169,93 @@ public class BloatwareService(ILogger<BloatwareService> logger, IOptionsMonitor<logger.LogError(ex, "Failed removing AppX package {Name}", appXPackage.Name);}}++ private static string? ResolveLogo(string installLocation)+ {+ try+ {+ // 1. Fast path: check for common high-quality logos first without parsing manifest+ var assetsDir = Path.Combine(installLocation, "Assets");+ if (Directory.Exists(assetsDir))+ {+ var commonLogos = new[] { "Logo.png" };+ foreach (var cl in commonLogos)+ {+ var path = Path.Combine(assetsDir, cl);+ if (File.Exists(path)) return path;+ }++ // If exact matches aren't found, try patterns that might have scale modifiers+ var highQualityPatterns = new[] { "*StoreLogo*.png", "*Logo*.png" };+ foreach (var pattern in highQualityPatterns)+ {+ var match = Directory.EnumerateFiles(assetsDir, pattern, SearchOption.TopDirectoryOnly)+ .OrderByDescending(f => new FileInfo(f).Length)+ .FirstOrDefault();+ if (match != null) return match;+ }+ }++ // 2. Fallback: Parse AppxManifest.xml+ var manifest = Path.Combine(installLocation, "AppxManifest.xml");+ if (!File.Exists(manifest)) return null;++ var doc = XDocument.Load(manifest);+ var root = doc.Root;+ if (root == null) return null;++ XNamespace ns = root.Name.Namespace;+ List<string> candidates = [];++ var props = root.Element(ns + "Properties");+ if (props != null)+ {+ var logo = props.Element(ns + "Logo")?.Value;+ if (!string.IsNullOrWhiteSpace(logo)) candidates.Add(logo);+ }++ var visual = root.Descendants().FirstOrDefault(e => e.Name.LocalName == "VisualElements" || e.Name.LocalName == "DefaultTile");+ if (visual != null)+ {+ AddAttr(candidates, visual, "Square150x150Logo");+ AddAttr(candidates, visual, "Wide310x150Logo");+ AddAttr(candidates, visual, "Square44x44Logo");+ }++ // Resolve manifest candidates+ foreach (var rel in candidates)+ {+ var clean = rel.Replace('/', '\\');+ var full = Path.Combine(installLocation, clean);++ if (File.Exists(full)) return full;++ // Fallback: search for file with matching name and extension but different scale modifiers+ var nameWithoutExt = Path.GetFileNameWithoutExtension(clean);+ var ext = Path.GetExtension(clean);+ var dirPath = Path.GetDirectoryName(clean);+ var searchDir = string.IsNullOrEmpty(dirPath) ? installLocation : Path.Combine(installLocation, dirPath);++ if (Directory.Exists(searchDir))+ {+ var found = Directory.EnumerateFiles(searchDir, $"{nameWithoutExt}*{ext}", SearchOption.TopDirectoryOnly)+ .OrderByDescending(f => new FileInfo(f).Length)+ .FirstOrDefault();+ if (found != null) return found;+ }+ }+ }+ catch+ {+ // Ignored: returning null if any file access/parsing fails+ }++ return null;+ }++ private static void AddAttr(List<string> list, XElement el, string name)+ {+ var val = el.Attribute(name)?.Value;+ if (!string.IsNullOrWhiteSpace(val)) list.Add(val);+ }}\ No newline at end of filediff --git a/optimizerDuck/Services/StartupManagerService.cs b/optimizerDuck/Services/StartupManagerService.csnew file mode 100644index 0000000..0253ed9--- /dev/null+++ b/optimizerDuck/Services/StartupManagerService.cs@@ -0,0 +1,356 @@+using Microsoft.Extensions.Logging;+using Microsoft.Win32;+using optimizerDuck.Core.Models.StartupManager;+using optimizerDuck.Services.OptimizationServices;+using System.Drawing;+using System.IO;+using System.Text.Json;+using System.Windows;+using System.Windows.Interop;+using System.Windows.Media;+using System.Windows.Media.Imaging;++namespace optimizerDuck.Services;++public class StartupManagerService(ILogger<StartupManagerService> logger)+{+ public async Task<List<StartupApp>> GetStartupAppsAsync()+ {+ var apps = new List<StartupApp>();++ await Task.Run(() =>+ {+ // 1. Registry+ ScanRegistryKey(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Run", StartupAppLocation.RegistryHKCURun, apps);+ ScanRegistryKey(Registry.LocalMachine, @"Software\Microsoft\Windows\CurrentVersion\Run", StartupAppLocation.RegistryHKLMRun, apps);+ ScanRegistryKey(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\RunOnce", StartupAppLocation.RegistryHKCURunOnce, apps);+ ScanRegistryKey(Registry.LocalMachine, @"Software\Microsoft\Windows\CurrentVersion\RunOnce", StartupAppLocation.RegistryHKLMRunOnce, apps);++ // 2. Startup Folders+ var userStartup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);+ var commonStartup = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup);++ ScanDirectory(userStartup, StartupAppLocation.UserStartupFolder, apps);+ ScanDirectory(commonStartup, StartupAppLocation.CommonStartupFolder, apps);+ });++ return apps.OrderBy(a => a.Name).ToList();+ }++ private void ScanRegistryKey(RegistryKey rootKey, string subKeyPath, StartupAppLocation location, List<StartupApp> apps)+ {+ try+ {+ using var key = rootKey.OpenSubKey(subKeyPath);+ if (key == null) return;++ // Determine the StartupApproved path based on Run vs RunOnce+ var approvedSubKeyPath = subKeyPath.Contains("RunOnce", StringComparison.OrdinalIgnoreCase)+ ? @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\RunOnce"+ : @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run";++ using var approvedKey = rootKey.OpenSubKey(approvedSubKeyPath);++ foreach (var valueName in key.GetValueNames())+ {+ var command = key.GetValue(valueName)?.ToString() ?? string.Empty;+ var isEnabled = IsStartupApproved(approvedKey, valueName);++ apps.Add(new StartupApp+ {+ Name = valueName,+ Publisher = "Registry",+ Command = command,+ Location = location,+ PathOrKey = $@"{rootKey.Name}\{subKeyPath}",+ OriginalValueNameOrFileName = valueName,+ IsEnabled = isEnabled,+ LogoImage = ExtractIcon(command)+ });+ }+ }+ catch (Exception ex)+ {+ logger.LogError(ex, "Failed to scan registry startup: {Path}", subKeyPath);+ }+ }++ /// <summary>+ /// Checks the StartupApproved registry to determine if an item is enabled.+ /// The binary data format: bytes[0] == 02 or 06 means enabled; 03 or 07 means disabled.+ /// If no entry exists in StartupApproved, assume enabled (item is present in Run key).+ /// </summary>+ private static bool IsStartupApproved(RegistryKey? approvedKey, string valueName)+ {+ if (approvedKey == null) return true;++ try+ {+ if (approvedKey.GetValue(valueName) is byte[] data && data.Length >= 4)+ {+ // Disabled flags: 03, 07; Enabled flags: 02, 06+ return data[0] != 0x03 && data[0] != 0x07;+ }+ }+ catch+ {+ // Ignore read errors, fall back to enabled+ }++ return true;+ }++ private void ScanDirectory(string dirPath, StartupAppLocation location, List<StartupApp> apps)+ {+ if (string.IsNullOrWhiteSpace(dirPath) || !Directory.Exists(dirPath)) return;++ try+ {+ foreach (var file in Directory.GetFiles(dirPath))+ {+ var isEnabled = !file.EndsWith(".disabled", StringComparison.OrdinalIgnoreCase);++ var fileName = Path.GetFileName(file);++ // Hide pure .ini files like desktop.ini+ if (fileName.Equals("desktop.ini", StringComparison.OrdinalIgnoreCase)) continue;++ var name = Path.GetFileNameWithoutExtension(isEnabled ? fileName : fileName.Replace(".disabled", ""));++ apps.Add(new StartupApp+ {+ Name = string.IsNullOrWhiteSpace(name) ? fileName : name,+ Publisher = "Folder Shortcut",+ Command = file,+ Location = location,+ PathOrKey = dirPath,+ OriginalValueNameOrFileName = fileName,+ IsEnabled = isEnabled,+ LogoImage = ExtractIcon(file)+ });+ }+ }+ catch (Exception ex)+ {+ logger.LogError(ex, "Failed to scan directory: {Dir}", dirPath);+ }+ }++ public async Task ToggleStartupApp(StartupApp app, bool enable)+ {+ await Task.Run(() =>+ {+ try+ {+ if (app.Location is StartupAppLocation.RegistryHKCURun or StartupAppLocation.RegistryHKLMRun or StartupAppLocation.RegistryHKCURunOnce or StartupAppLocation.RegistryHKLMRunOnce)+ {+ ToggleRegistryStartupApp(app, enable);+ }+ else // Folders+ {+ ToggleFolderStartupApp(app, enable);+ }+ }+ catch (Exception ex)+ {+ logger.LogError(ex, "Failed to toggle startup app {Name}", app.Name);+ }+ });+ }++ private void ToggleRegistryStartupApp(StartupApp app, bool enable)+ {+ // Parse RootKey and SubKey from app.PathOrKey+ var firstSlash = app.PathOrKey.IndexOf('\\');+ if (firstSlash < 0) return;++ var rootKeyStr = app.PathOrKey[..firstSlash];+ var rootKey = rootKeyStr switch+ {+ "HKEY_CURRENT_USER" => Registry.CurrentUser,+ "HKEY_LOCAL_MACHINE" => Registry.LocalMachine,+ _ => null+ };+ if (rootKey == null) return;++ // Write enable/disable to StartupApproved\Run (same mechanism as Task Manager)+ var isRunOnce = app.Location is StartupAppLocation.RegistryHKCURunOnce or StartupAppLocation.RegistryHKLMRunOnce;+ var approvedSubKeyPath = isRunOnce+ ? @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\RunOnce"+ : @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run";++ using var approvedKey = rootKey.OpenSubKey(approvedSubKeyPath, true)+ ?? rootKey.CreateSubKey(approvedSubKeyPath, true);++ // Binary format: 12 bytes. First 4 bytes = status flag, rest = timestamp (zeros for manual toggle)+ var data = new byte[12];+ data[0] = enable ? (byte)0x02 : (byte)0x03;+ approvedKey.SetValue(app.OriginalValueNameOrFileName, data, RegistryValueKind.Binary);+ }++ private static void ToggleFolderStartupApp(StartupApp app, bool enable)+ {+ var currentPath = Path.Combine(app.PathOrKey, app.OriginalValueNameOrFileName);+ if (!File.Exists(currentPath)) return;++ if (enable)+ {+ if (currentPath.EndsWith(".disabled", StringComparison.OrdinalIgnoreCase))+ {+ var newPath = currentPath[..^9]; // remove .disabled+ File.Move(currentPath, newPath);+ }+ }+ else+ {+ if (!currentPath.EndsWith(".disabled", StringComparison.OrdinalIgnoreCase))+ {+ var newPath = currentPath + ".disabled";+ File.Move(currentPath, newPath);+ }+ }+ }++ public async Task<List<StartupTask>> GetStartupTasksAsync()+ {+ var tasks = new List<StartupTask>();+ try+ {+ var result = await ShellService.PowerShellAsync(@"+ Get-ScheduledTask |+ Where-Object { $_.Triggers.CimClass.CimClassName -match 'LogonTrigger' -and $_.TaskPath -notmatch '\\Microsoft\\' } |+ Select-Object TaskName, TaskPath, State, Description |+ ConvertTo-Json -Depth 2+ ");++ if (result.ExitCode == 0 && !string.IsNullOrWhiteSpace(result.Stdout))+ {+ try+ {+ using var doc = JsonDocument.Parse(result.Stdout);+ if (doc.RootElement.ValueKind == JsonValueKind.Array)+ {+ foreach (var el in doc.RootElement.EnumerateArray())+ {+ ParseTaskElement(el, tasks);+ }+ }+ else if (doc.RootElement.ValueKind == JsonValueKind.Object)+ {+ ParseTaskElement(doc.RootElement, tasks);+ }+ }+ catch (Exception parserEx)+ {+ logger.LogError(parserEx, "Failed to parse json: {Json}", result.Stdout);+ }+ }+ }+ catch (Exception ex)+ {+ logger.LogError(ex, "Failed to get scheduled tasks");+ }++ return tasks.OrderBy(t => t.TaskName).ToList();+ }++ private void ParseTaskElement(JsonElement el, List<StartupTask> tasks)+ {+ var name = el.TryGetProperty("TaskName", out var nProp) ? nProp.GetString() : "";+ var path = el.TryGetProperty("TaskPath", out var pProp) ? pProp.GetString() : "";+ var state = el.TryGetProperty("State", out var sProp) ? sProp.GetInt32() : 0;+ var desc = el.TryGetProperty("Description", out var dProp) ? dProp.GetString() : "";++ if (string.IsNullOrWhiteSpace(name)) return;++ tasks.Add(new StartupTask+ {+ TaskName = name,+ TaskPath = path,+ Description = desc,+ IsEnabled = state != 1 // 1 is Disabled in TaskState enum+ });+ }++ public async Task ToggleStartupTask(StartupTask task, bool enable)+ {+ try+ {+ var command = enable ? "Enable-ScheduledTask" : "Disable-ScheduledTask";+ var script = $@"{command} -TaskPath ""{task.TaskPath}"" -TaskName ""{task.TaskName}""";++ var result = await ShellService.PowerShellAsync(script);+ if (result.ExitCode != 0)+ {+ logger.LogWarning("Toggle tasks returned exit code {ExitCode}. Stderr: {Stderr}", result.ExitCode, result.Stderr);+ }+ }+ catch (Exception ex)+ {+ logger.LogError(ex, "Failed to toggle task {Name}", task.TaskName);+ }+ }++ private ImageSource? ExtractIcon(string command)+ {+ try+ {+ var path = command.Trim('\"');+ var exeIdx = path.IndexOf(".exe", StringComparison.OrdinalIgnoreCase);+ if (exeIdx > 0)+ {+ path = path[..(exeIdx + 4)].Trim('\"', ' ', '\'');+ }++ if (!File.Exists(path))+ {+ // try to see if it is in PATH+ if (!path.Contains('\\') && !path.Contains('/'))+ {+ path = GetFullPathFromEnvironment(path);+ if (string.IsNullOrEmpty(path) || !File.Exists(path))+ return null;+ }+ else+ {+ return null;+ }+ }++ using var icon = Icon.ExtractAssociatedIcon(path);+ if (icon != null)+ {+ var imageSource = Imaging.CreateBitmapSourceFromHIcon(+ icon.Handle,+ Int32Rect.Empty,+ BitmapSizeOptions.FromEmptyOptions());+ imageSource.Freeze(); // Crucial for cross-thread access+ return imageSource;+ }+ }+ catch+ {+ // Ignored, fallback to generic or null+ }+ return null;+ }++ private string? GetFullPathFromEnvironment(string fileName)+ {+ if (File.Exists(fileName))+ return Path.GetFullPath(fileName);++ var values = Environment.GetEnvironmentVariable("PATH");+ if (values == null)+ return null;++ foreach (var path in values.Split(Path.PathSeparator))+ {+ var fullPath = Path.Combine(path, fileName);+ if (File.Exists(fullPath))+ return fullPath;+ }++ return null;+ }+}diff --git a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.csindex 4e0a65a..43eb16a 100644--- a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs+++ b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs@@ -32,10 +32,12 @@ public partial class BloatwareViewModel : ViewModel// Search, Filter, Sort[ObservableProperty] private string _searchText = string.Empty;+[ObservableProperty] private int _selectedRiskFilterIndex; // 0=All, 1=Safe, 2=Caution[ObservableProperty] private int _selectedSortByIndex; // 0=Default, 1=Name, 2=Publisher, 3=Riskprivate CancellationTokenSource? _searchDebounce;+partial void OnSearchTextChanged(string value) => DebounceSearch();private async void DebounceSearch()@@ -49,7 +51,9 @@ public partial class BloatwareViewModel : ViewModel}catch (TaskCanceledException) { }}+partial void OnSelectedRiskFilterIndexChanged(int value) => ApplyFilter();+partial void OnSelectedSortByIndexChanged(int value) => ApplyFilter();public bool HasSelectedItems => AppxPackages.Any(x => x.IsSelected);@@ -130,8 +134,9 @@ public partial class BloatwareViewModel : ViewModelforeach (var p in AppxPackages)p.PropertyChanged -= Item_PropertyChanged;+ var filtered = query.ToList();AppxPackages.Clear();- foreach (var package in query)+ foreach (var package in filtered)AppxPackages.Add(package);}diff --git a/optimizerDuck/UI/ViewModels/Pages/StartupManagerViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/StartupManagerViewModel.csnew file mode 100644index 0000000..d4b2aa2--- /dev/null+++ b/optimizerDuck/UI/ViewModels/Pages/StartupManagerViewModel.cs@@ -0,0 +1,148 @@+using CommunityToolkit.Mvvm.ComponentModel;+using CommunityToolkit.Mvvm.Input;+using System.Collections.ObjectModel;+using System.ComponentModel;+using Microsoft.Extensions.Logging;+using optimizerDuck.Core.Models.StartupManager;+using optimizerDuck.Services;++namespace optimizerDuck.UI.ViewModels.Pages;++public partial class StartupManagerViewModel : ViewModel+{+ private bool _isInitialized;+ private readonly StartupManagerService _startupManagerService;+ private readonly ILogger<StartupManagerViewModel> _logger;++ private readonly List<StartupApp> _allApps = [];+ private readonly List<StartupTask> _allTasks = [];++ public ObservableCollection<StartupApp> Apps { get; } = [];+ public ObservableCollection<StartupTask> Tasks { get; } = [];++ [ObservableProperty]+ [NotifyPropertyChangedFor(nameof(IsNotLoading))]+ private bool _isLoading;++ [ObservableProperty]+ private string _searchText = string.Empty;++ public bool IsNotLoading => !IsLoading;++ public bool HasApps => Apps.Count > 0;+ public bool HasTasks => Tasks.Count > 0;+ public bool HasData => HasApps || HasTasks;++ public StartupManagerViewModel(StartupManagerService startupManagerService, ILogger<StartupManagerViewModel> logger)+ {+ _startupManagerService = startupManagerService;+ _logger = logger;+ }++ public override async Task OnNavigatedToAsync()+ {+ if (_isInitialized)+ return;++ _isInitialized = true;+ await LoadDataAsync();+ }++ [RelayCommand]+ private async Task Refresh()+ {+ await LoadDataAsync();+ }++ partial void OnSearchTextChanged(string value)+ {+ ApplyFilter();+ }++ private async Task LoadDataAsync()+ {+ IsLoading = true;+ _allApps.Clear();+ _allTasks.Clear();+ Apps.Clear();+ Tasks.Clear();++ try+ {+ var apps = await _startupManagerService.GetStartupAppsAsync();+ _allApps.AddRange(apps);++ var tasks = await _startupManagerService.GetStartupTasksAsync();+ _allTasks.AddRange(tasks);++ ApplyFilter();+ }+ catch (Exception ex)+ {+ _logger.LogError(ex, "Failed to load startup manager data");+ }+ finally+ {+ IsLoading = false;+ }+ }++ private void ApplyFilter()+ {+ // Unsubscribe existing items+ foreach (var app in Apps) app.PropertyChanged -= App_PropertyChanged;+ foreach (var task in Tasks) task.PropertyChanged -= Task_PropertyChanged;++ Apps.Clear();+ Tasks.Clear();++ var search = SearchText.Trim();+ var hasSearch = !string.IsNullOrWhiteSpace(search);++ foreach (var app in _allApps)+ {+ if (hasSearch &&+ !app.Name.Contains(search, StringComparison.OrdinalIgnoreCase) &&+ !app.Command.Contains(search, StringComparison.OrdinalIgnoreCase) &&+ !app.Publisher.Contains(search, StringComparison.OrdinalIgnoreCase))+ continue;++ app.PropertyChanged -= App_PropertyChanged;+ app.PropertyChanged += App_PropertyChanged;+ Apps.Add(app);+ }++ foreach (var task in _allTasks)+ {+ if (hasSearch &&+ !task.TaskName.Contains(search, StringComparison.OrdinalIgnoreCase) &&+ !(task.Description?.Contains(search, StringComparison.OrdinalIgnoreCase) ?? false) &&+ !task.TaskPath.Contains(search, StringComparison.OrdinalIgnoreCase))+ continue;++ task.PropertyChanged -= Task_PropertyChanged;+ task.PropertyChanged += Task_PropertyChanged;+ Tasks.Add(task);+ }++ OnPropertyChanged(nameof(HasApps));+ OnPropertyChanged(nameof(HasTasks));+ OnPropertyChanged(nameof(HasData));+ }++ private async void App_PropertyChanged(object? sender, PropertyChangedEventArgs e)+ {+ if (e.PropertyName == nameof(StartupApp.IsEnabled) && sender is StartupApp app)+ {+ await _startupManagerService.ToggleStartupApp(app, app.IsEnabled);+ }+ }++ private async void Task_PropertyChanged(object? sender, PropertyChangedEventArgs e)+ {+ if (e.PropertyName == nameof(StartupTask.IsEnabled) && sender is StartupTask task)+ {+ await _startupManagerService.ToggleStartupTask(task, task.IsEnabled);+ }+ }+}diff --git a/optimizerDuck/UI/Views/Dialogs/OptimizationResultDialog.xaml b/optimizerDuck/UI/Views/Dialogs/OptimizationResultDialog.xamlindex 67ddcf0..170e414 100644--- a/optimizerDuck/UI/Views/Dialogs/OptimizationResultDialog.xaml+++ b/optimizerDuck/UI/Views/Dialogs/OptimizationResultDialog.xaml@@ -4,7 +4,7 @@mc:Ignorable="d"x:Class="optimizerDuck.UI.Views.Dialogs.OptimizationResultDialog"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"- xmlns:converters="clr-namespace:optimizerDuck.Common.Helpers.Converters"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"diff --git a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml b/optimizerDuck/UI/Views/Pages/BloatwarePage.xamlindex 21961e1..7adfe9b 100644--- a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml+++ b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml@@ -3,7 +3,7 @@xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:bloatware="clr-namespace:optimizerDuck.Core.Models.Bloatware"- xmlns:converters="clr-namespace:optimizerDuck.Common.Helpers.Converters"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"xmlns:local="clr-namespace:optimizerDuck.UI.Views.Pages"@@ -275,6 +275,7 @@<Grid><Grid.ColumnDefinitions>+ <ColumnDefinition Width="Auto" /><ColumnDefinition Width="Auto" /><ColumnDefinition Width="*" /><ColumnDefinition Width="Auto" />@@ -287,8 +288,18 @@VerticalAlignment="Top"IsChecked="{Binding IsSelected, Mode=TwoWay}" />+ <!-- Logo Image -->+ <Image+ Grid.Column="1"+ Width="36"+ Height="36"+ Margin="0,0,12,0"+ VerticalAlignment="Top"+ Source="{Binding LogoImage}"+ Stretch="UniformToFill" />+<!-- Content -->- <StackPanel Grid.Column="1">+ <StackPanel Grid.Column="2"><!-- Top row --><DockPanel LastChildFill="False">diff --git a/optimizerDuck/UI/Views/Pages/DashboardPage.xaml b/optimizerDuck/UI/Views/Pages/DashboardPage.xamlindex 20e21b3..f2268eb 100644--- a/optimizerDuck/UI/Views/Pages/DashboardPage.xaml+++ b/optimizerDuck/UI/Views/Pages/DashboardPage.xaml@@ -2,7 +2,7 @@x:Class="optimizerDuck.UI.Views.Pages.DashboardPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"- xmlns:converters="clr-namespace:optimizerDuck.Common.Helpers.Converters"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"diff --git a/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml b/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xamlindex e3dc65f..9716032 100644--- a/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml+++ b/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml@@ -3,7 +3,7 @@xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:cleanup="clr-namespace:optimizerDuck.Core.Models.Cleanup"- xmlns:converters="clr-namespace:optimizerDuck.Common.Helpers.Converters"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"xmlns:local="clr-namespace:optimizerDuck.UI.Views.Pages"@@ -352,7 +352,6 @@Foreground="{DynamicResource TextFillColorSecondaryBrush}"Text="{ext:Loc DiskCleanup.EmptySize}" /></Border>-</Grid></Border></StackPanel>diff --git a/optimizerDuck/UI/Views/Pages/Optimizations/OptimizationPage.xaml b/optimizerDuck/UI/Views/Pages/Optimizations/OptimizationPage.xamlindex c0a70ad..d6f3dbf 100644--- a/optimizerDuck/UI/Views/Pages/Optimizations/OptimizationPage.xaml+++ b/optimizerDuck/UI/Views/Pages/Optimizations/OptimizationPage.xaml@@ -11,7 +11,7 @@ui:Design.Foreground="White"x:Class="optimizerDuck.UI.Views.Pages.Optimizations.OptimizationPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"- xmlns:converters="clr-namespace:optimizerDuck.Common.Helpers.Converters"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"diff --git a/optimizerDuck/UI/Views/Pages/SettingsPage.xaml b/optimizerDuck/UI/Views/Pages/SettingsPage.xamlindex 398b9a4..b5a6584 100644--- a/optimizerDuck/UI/Views/Pages/SettingsPage.xaml+++ b/optimizerDuck/UI/Views/Pages/SettingsPage.xaml@@ -2,7 +2,7 @@x:Class="optimizerDuck.UI.Views.Pages.SettingsPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"- xmlns:converters="clr-namespace:optimizerDuck.Common.Helpers.Converters"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"diff --git a/optimizerDuck/UI/Views/Pages/StartupManagerPage.xaml b/optimizerDuck/UI/Views/Pages/StartupManagerPage.xamlnew file mode 100644index 0000000..2877f11--- /dev/null+++ b/optimizerDuck/UI/Views/Pages/StartupManagerPage.xaml@@ -0,0 +1,301 @@+<Page+ x:Class="optimizerDuck.UI.Views.Pages.StartupManagerPage"+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ xmlns:converters="clr-namespace:optimizerDuck.Common.Converters"+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"+ xmlns:ext="clr-namespace:optimizerDuck.Common.Extensions"+ xmlns:local="clr-namespace:optimizerDuck.UI.Views.Pages"+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"+ xmlns:models="clr-namespace:optimizerDuck.Core.Models.StartupManager"+ xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"+ Title="StartupManagerPage"+ Margin="0,32,0,0"+ d:DataContext="{d:DesignInstance local:StartupManagerPage}"+ Foreground="{DynamicResource TextFillColorPrimaryBrush}"+ ScrollViewer.CanContentScroll="False"+ mc:Ignorable="d">++ <Page.Resources>+ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />+ <converters:GreaterThanZeroToVisibilityConverter x:Key="GreaterThanZeroToVisibilityConverter" />+ <converters:ZeroToVisibilityConverter x:Key="ZeroToVisibilityConverter" />+ </Page.Resources>++ <Grid RowDefinitions="Auto, *">+ <!-- Header -->+ <StackPanel Margin="0,0,0,20">+ <ui:TextBlock FontTypography="Title" Text="{ext:Loc StartupManager.Header.Title}" />+ <ui:TextBlock+ Margin="0,4,0,0"+ Appearance="Secondary"+ FontTypography="Body"+ Text="{ext:Loc StartupManager.Header.Description}"+ TextWrapping="Wrap" />+ </StackPanel>++ <!-- Loading Indicator -->+ <Border Grid.Row="1" Visibility="{Binding ViewModel.IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}">+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">+ <ui:ProgressRing+ Width="48"+ Height="48"+ Margin="0,0,0,16"+ HorizontalAlignment="Center"+ VerticalAlignment="Center"+ IsIndeterminate="True" />+ <ui:TextBlock+ HorizontalAlignment="Center"+ FontTypography="BodyStrong"+ Text="{ext:Loc StartupManager.Loading}" />+ <ui:TextBlock+ Margin="0,4,0,0"+ HorizontalAlignment="Center"+ Appearance="Secondary"+ FontTypography="Caption"+ Text="{ext:Loc StartupManager.Loading.Hint}" />+ </StackPanel>+ </Border>++ <!-- Empty State (no data at all) -->+ <Border Grid.Row="1">+ <Border.Style>+ <Style TargetType="Border">+ <Setter Property="Visibility" Value="Collapsed" />+ <Style.Triggers>+ <MultiDataTrigger>+ <MultiDataTrigger.Conditions>+ <Condition Binding="{Binding ViewModel.HasData}" Value="False" />+ <Condition Binding="{Binding ViewModel.IsLoading}" Value="False" />+ </MultiDataTrigger.Conditions>+ <Setter Property="Visibility" Value="Visible" />+ </MultiDataTrigger>+ </Style.Triggers>+ </Style>+ </Border.Style>++ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">+ <ui:SymbolIcon+ Margin="0,0,0,15"+ HorizontalAlignment="Center"+ FontSize="46"+ Foreground="{DynamicResource SystemFillColorCriticalBrush}"+ Symbol="AppGeneric24" />+ <ui:TextBlock+ HorizontalAlignment="Center"+ FontTypography="Subtitle"+ Text="{ext:Loc StartupManager.Empty.Title}" />+ <ui:TextBlock+ Margin="0,0,0,10"+ HorizontalAlignment="Center"+ Appearance="Secondary"+ FontTypography="Body"+ Text="{ext:Loc StartupManager.Empty.Description}" />+ <ui:Button+ HorizontalAlignment="Center"+ Appearance="Primary"+ Command="{Binding ViewModel.RefreshCommand}"+ Content="{ext:Loc StartupManager.Menu.Refresh}"+ Icon="{ui:SymbolIcon ArrowClockwise24,+ FontSize=18}" />+ </StackPanel>+ </Border>++ <!-- Main Content -->+ <Border Grid.Row="1" Visibility="{Binding ViewModel.HasData, Converter={StaticResource BooleanToVisibilityConverter}}">+ <Grid RowDefinitions="Auto,*">+ <!-- Toolbar -->+ <WrapPanel+ Grid.Row="0"+ Margin="0,0,0,12"+ Orientation="Horizontal">+ <!-- Search -->+ <ui:TextBox+ MinWidth="220"+ Margin="0,0,8,0"+ VerticalAlignment="Center"+ Icon="{ui:SymbolIcon Search24}"+ PlaceholderText="{ext:Loc Common.Search.Placeholder}"+ Text="{Binding ViewModel.SearchText, UpdateSourceTrigger=PropertyChanged}" />++ <ui:Button+ Appearance="Primary"+ Command="{Binding ViewModel.RefreshCommand}"+ Content="{ext:Loc StartupManager.Menu.Refresh}"+ Icon="{ui:SymbolIcon ArrowClockwise24,+ FontSize=18}" />+ </WrapPanel>++ <!-- Scrollable content -->+ <ScrollViewer Grid.Row="1" Margin="0,0,16,0">+ <StackPanel>+ <!-- Startup Apps Section -->+ <ui:CardExpander+ Margin="0,0,0,12"+ Icon="{ui:SymbolIcon Apps24}"+ IsExpanded="True"+ Visibility="{Binding ViewModel.Apps.Count, Converter={StaticResource GreaterThanZeroToVisibilityConverter}}">+ <ui:CardExpander.Header>+ <StackPanel Orientation="Horizontal">+ <ui:TextBlock+ VerticalAlignment="Center"+ FontTypography="BodyStrong"+ Text="{ext:Loc StartupManager.Apps.Title}" />+ <Border+ Margin="8,0,0,0"+ Padding="8,2"+ VerticalAlignment="Center"+ Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"+ CornerRadius="10">+ <ui:TextBlock+ VerticalAlignment="Center"+ Appearance="Tertiary"+ FontTypography="Caption"+ Text="{Binding ViewModel.Apps.Count}" />+ </Border>+ </StackPanel>+ </ui:CardExpander.Header>++ <ItemsControl ItemsSource="{Binding ViewModel.Apps}">+ <ItemsControl.ItemTemplate>+ <DataTemplate DataType="{x:Type models:StartupApp}">+ <Border+ Margin="0,0,0,4"+ Padding="12,10"+ Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"+ CornerRadius="6">+ <Grid>+ <Grid.ColumnDefinitions>+ <ColumnDefinition Width="Auto" />+ <ColumnDefinition Width="*" />+ <ColumnDefinition Width="Auto" />+ </Grid.ColumnDefinitions>++ <!-- Logo -->+ <Image+ Grid.Column="0"+ Width="36"+ Height="36"+ Margin="0,0,12,0"+ VerticalAlignment="Center"+ Source="{Binding LogoImage}"+ Stretch="UniformToFill" />++ <StackPanel Grid.Column="1" VerticalAlignment="Center">+ <!-- Name + Location badge -->+ <DockPanel LastChildFill="False">+ <ui:TextBlock FontTypography="BodyStrong" Text="{Binding Name}" />+ <Border+ Margin="8,0,0,0"+ Padding="6,1"+ VerticalAlignment="Center"+ Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"+ CornerRadius="4">+ <ui:TextBlock+ VerticalAlignment="Center"+ Appearance="Tertiary"+ FontTypography="Caption"+ Text="{Binding LocationDisplay}" />+ </Border>+ </DockPanel>+ <!-- Publisher -->+ <ui:TextBlock+ Margin="0,2,0,0"+ Appearance="Secondary"+ FontTypography="Caption"+ Text="{Binding Publisher}" />+ <!-- Command -->+ <ui:TextBlock+ Margin="0,2,0,0"+ Appearance="Disabled"+ FontTypography="Caption"+ Text="{Binding Command}"+ TextTrimming="CharacterEllipsis" />+ </StackPanel>++ <ui:ToggleSwitch+ Grid.Column="2"+ VerticalAlignment="Center"+ IsChecked="{Binding IsEnabled, Mode=TwoWay}" />+ </Grid>+ </Border>+ </DataTemplate>+ </ItemsControl.ItemTemplate>+ </ItemsControl>+ </ui:CardExpander>++ <!-- Scheduled Tasks Section -->+ <ui:CardExpander+ Margin="0,0,0,12"+ Icon="{ui:SymbolIcon TaskListLtr24}"+ IsExpanded="True"+ Visibility="{Binding ViewModel.Tasks.Count, Converter={StaticResource GreaterThanZeroToVisibilityConverter}}">+ <ui:CardExpander.Header>+ <StackPanel Orientation="Horizontal">+ <ui:TextBlock+ VerticalAlignment="Center"+ FontTypography="BodyStrong"+ Text="{ext:Loc StartupManager.Tasks.Title}" />+ <Border+ Margin="8,0,0,0"+ Padding="8,2"+ VerticalAlignment="Center"+ Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"+ CornerRadius="10">+ <ui:TextBlock+ VerticalAlignment="Center"+ Appearance="Tertiary"+ FontTypography="Caption"+ Text="{Binding ViewModel.Tasks.Count}" />+ </Border>+ </StackPanel>+ </ui:CardExpander.Header>++ <ItemsControl ItemsSource="{Binding ViewModel.Tasks}">+ <ItemsControl.ItemTemplate>+ <DataTemplate DataType="{x:Type models:StartupTask}">+ <Border+ Margin="0,0,0,4"+ Padding="12,10"+ Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"+ CornerRadius="6">+ <Grid>+ <Grid.ColumnDefinitions>+ <ColumnDefinition Width="*" />+ <ColumnDefinition Width="Auto" />+ </Grid.ColumnDefinitions>++ <StackPanel+ Grid.Column="0"+ Margin="0,0,12,0"+ VerticalAlignment="Center">+ <ui:TextBlock FontTypography="BodyStrong" Text="{Binding TaskName}" />+ <ui:TextBlock+ Margin="0,2,0,0"+ Appearance="Secondary"+ FontTypography="Caption"+ Text="{Binding Description}"+ TextTrimming="CharacterEllipsis" />+ <ui:TextBlock+ Margin="0,2,0,0"+ Appearance="Disabled"+ FontTypography="Caption"+ Text="{Binding TaskPath}" />+ </StackPanel>++ <ui:ToggleSwitch+ Grid.Column="1"+ VerticalAlignment="Center"+ IsChecked="{Binding IsEnabled, Mode=TwoWay}" />+ </Grid>+ </Border>+ </DataTemplate>+ </ItemsControl.ItemTemplate>+ </ItemsControl>+ </ui:CardExpander>+ </StackPanel>+ </ScrollViewer>+ </Grid>+ </Border>+ </Grid>+</Page>\ No newline at end of filediff --git a/optimizerDuck/UI/Views/Pages/StartupManagerPage.xaml.cs b/optimizerDuck/UI/Views/Pages/StartupManagerPage.xaml.csnew file mode 100644index 0000000..33fdef0--- /dev/null+++ b/optimizerDuck/UI/Views/Pages/StartupManagerPage.xaml.cs@@ -0,0 +1,17 @@+using optimizerDuck.UI.ViewModels.Pages;+using Wpf.Ui.Abstractions.Controls;+using Wpf.Ui.Controls;++namespace optimizerDuck.UI.Views.Pages;++public partial class StartupManagerPage : INavigableView<StartupManagerViewModel>+{+ public StartupManagerViewModel ViewModel { get; }++ public StartupManagerPage(StartupManagerViewModel viewModel)+ {+ ViewModel = viewModel;+ DataContext = this;+ InitializeComponent();+ }+}\ No newline at end of filediff --git a/optimizerDuck/UI/Views/Windows/MainWindow.xaml b/optimizerDuck/UI/Views/Windows/MainWindow.xamlindex 1f286b8..e7ba1e3 100644--- a/optimizerDuck/UI/Views/Windows/MainWindow.xaml+++ b/optimizerDuck/UI/Views/Windows/MainWindow.xaml@@ -52,6 +52,11 @@Icon="{ui:SymbolIcon Delete24}"TargetPageType="{x:Type pages:BloatwarePage}" />+ <ui:NavigationViewItem+ Content="{extensions:Loc Sidebar.StartupManager}"+ Icon="{ui:SymbolIcon AppFolder24}"+ TargetPageType="{x:Type pages:StartupManagerPage}" />+<ui:NavigationViewItemContent="{extensions:Loc Sidebar.DiskCleanup}"Icon="{ui:SymbolIcon HardDrive20}"