Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

refactor: move converters to common. feat: add features to it

fatDuckd718463d21be
diff --git a/optimizerDuck/Common/Helpers/Converters/BooleanConverter.cs b/optimizerDuck/Common/Converters/BooleanConverter.cs
similarity index 93%
rename from optimizerDuck/Common/Helpers/Converters/BooleanConverter.cs
rename to optimizerDuck/Common/Converters/BooleanConverter.cs
index 2aa21d6..5f349fe 100644
--- a/optimizerDuck/Common/Helpers/Converters/BooleanConverter.cs
+++ b/optimizerDuck/Common/Converters/BooleanConverter.cs
@@ -1,7 +1,7 @@
using System.Globalization;
using System.Windows.Data;
-namespace optimizerDuck.Common.Helpers.Converters;
+namespace optimizerDuck.Common.Converters;
// Source - https://stackoverflow.com/a/5182660
// Posted by Atif Aziz, modified by community. See post 'Timeline' for change history
diff --git a/optimizerDuck/Common/Helpers/Converters/BooleanToVisibilityConverter.cs b/optimizerDuck/Common/Converters/BooleanToVisibilityConverter.cs
similarity index 78%
rename from optimizerDuck/Common/Helpers/Converters/BooleanToVisibilityConverter.cs
rename to optimizerDuck/Common/Converters/BooleanToVisibilityConverter.cs
index 09b0a43..35e2cac 100644
--- a/optimizerDuck/Common/Helpers/Converters/BooleanToVisibilityConverter.cs
+++ b/optimizerDuck/Common/Converters/BooleanToVisibilityConverter.cs
@@ -1,3 +1,4 @@
+using optimizerDuck.Common.Converters;
using System.Windows;
namespace optimizerDuck.Common.Helpers.Converters;
diff --git a/optimizerDuck/Common/Helpers/Converters/EmptyWhileNotLoadingConverter.cs b/optimizerDuck/Common/Converters/EmptyWhileNotLoadingConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/EmptyWhileNotLoadingConverter.cs
rename to optimizerDuck/Common/Converters/EmptyWhileNotLoadingConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/GreaterThanNumberToVisibilityConverter.cs b/optimizerDuck/Common/Converters/GreaterThanNumberToVisibilityConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/GreaterThanNumberToVisibilityConverter.cs
rename to optimizerDuck/Common/Converters/GreaterThanNumberToVisibilityConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/GreaterThanZeroToVisibilityConverter.cs b/optimizerDuck/Common/Converters/GreaterThanZeroToVisibilityConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/GreaterThanZeroToVisibilityConverter.cs
rename to optimizerDuck/Common/Converters/GreaterThanZeroToVisibilityConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/InverseBooleanConverter.cs b/optimizerDuck/Common/Converters/InverseBooleanConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/InverseBooleanConverter.cs
rename to optimizerDuck/Common/Converters/InverseBooleanConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/MBToGBConverter.cs b/optimizerDuck/Common/Converters/MBToGBConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/MBToGBConverter.cs
rename to optimizerDuck/Common/Converters/MBToGBConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/MinusNumberConverter.cs b/optimizerDuck/Common/Converters/MinusNumberConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/MinusNumberConverter.cs
rename to optimizerDuck/Common/Converters/MinusNumberConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/NullToVisibilityConverter.cs b/optimizerDuck/Common/Converters/NullToVisibilityConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/NullToVisibilityConverter.cs
rename to optimizerDuck/Common/Converters/NullToVisibilityConverter.cs
diff --git a/optimizerDuck/Common/Converters/SizeToBrushConverter.cs b/optimizerDuck/Common/Converters/SizeToBrushConverter.cs
new file mode 100644
index 0000000..924e5ed
--- /dev/null
+++ b/optimizerDuck/Common/Converters/SizeToBrushConverter.cs
@@ -0,0 +1,38 @@
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace optimizerDuck.Common.Helpers.Converters;
+
+/// <summary>
+/// Converts a byte size (long) to a color brush:
+/// Green for small (&lt; 10 MB), Orange for medium (10-100 MB), Red for large (&gt; 100 MB).
+/// </summary>
+public class SizeToBrushConverter : IValueConverter
+{
+ private static readonly SolidColorBrush GreenBrush = ThemeResource.Get<SolidColorBrush>("SystemFillColorSuccessBrush");
+ private static readonly SolidColorBrush OrangeBrush = ThemeResource.Get<SolidColorBrush>("SystemFillColorCautionBrush");
+ private static readonly SolidColorBrush RedBrush = ThemeResource.Get<SolidColorBrush>("SystemFillColorCriticalBrush");
+ private static readonly SolidColorBrush DefaultBrush = new(Color.FromArgb(0x0, 0x0, 0x0, 0x0));
+
+ private const long TenMB = 10L * 1024 * 1024;
+ private const long HundredMB = 100L * 1024 * 1024;
+
+ public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ if (value is not long bytes) return DefaultBrush;
+
+ return bytes switch
+ {
+ <= 0 => DefaultBrush,
+ < TenMB => GreenBrush,
+ < HundredMB => OrangeBrush,
+ _ => RedBrush
+ };
+ }
+
+ public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
diff --git a/optimizerDuck/Common/Helpers/Converters/ThemeToGitHubIconConverter.cs b/optimizerDuck/Common/Converters/ThemeToGitHubIconConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/ThemeToGitHubIconConverter.cs
rename to optimizerDuck/Common/Converters/ThemeToGitHubIconConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/ThemeToIndexConverter.cs b/optimizerDuck/Common/Converters/ThemeToIndexConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/ThemeToIndexConverter.cs
rename to optimizerDuck/Common/Converters/ThemeToIndexConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/WidthToColumnConverter.cs b/optimizerDuck/Common/Converters/WidthToColumnConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/WidthToColumnConverter.cs
rename to optimizerDuck/Common/Converters/WidthToColumnConverter.cs
diff --git a/optimizerDuck/Common/Helpers/Converters/ZeroToVisibilityConverter.cs b/optimizerDuck/Common/Converters/ZeroToVisibilityConverter.cs
similarity index 100%
rename from optimizerDuck/Common/Helpers/Converters/ZeroToVisibilityConverter.cs
rename to optimizerDuck/Common/Converters/ZeroToVisibilityConverter.cs
diff --git a/optimizerDuck/Resources/Languages/Translations.Designer.cs b/optimizerDuck/Resources/Languages/Translations.Designer.cs
index 812de7f..6de394b 100644
--- a/optimizerDuck/Resources/Languages/Translations.Designer.cs
+++ b/optimizerDuck/Resources/Languages/Translations.Designer.cs
@@ -78,6 +78,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Manage and remove pre-installed applications that you don&apos;t need.
+ /// </summary>
+ public static string Bloatware_Header_Description {
+ get {
+ return ResourceManager.GetString("Bloatware.Header.Description", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Bloatware.
/// </summary>
@@ -123,6 +132,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Unselect All Safe.
+ /// </summary>
+ public static string Bloatware_Menu_UnselectAllSafe {
+ get {
+ return ResourceManager.GetString("Bloatware.Menu.UnselectAllSafe", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to No results found. Try a different search term or filter..
/// </summary>
@@ -438,6 +456,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to System overview and quick actions.
+ /// </summary>
+ public static string Dashboard_Header_Description {
+ get {
+ return ResourceManager.GetString("Dashboard.Header.Description", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Options.
/// </summary>
@@ -591,6 +618,33 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Build {0}.
+ /// </summary>
+ public static string Dashboard_SystemInfo_Os_Build {
+ get {
+ return ResourceManager.GetString("Dashboard.SystemInfo.Os.Build", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Desktop.
+ /// </summary>
+ public static string Dashboard_SystemInfo_Os_DeviceType_Desktop {
+ get {
+ return ResourceManager.GetString("Dashboard.SystemInfo.Os.DeviceType.Desktop", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Laptop.
+ /// </summary>
+ public static string Dashboard_SystemInfo_Os_DeviceType_Laptop {
+ get {
+ return ResourceManager.GetString("Dashboard.SystemInfo.Os.DeviceType.Laptop", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to {0} GB Available.
/// </summary>
@@ -658,9 +712,243 @@ namespace optimizerDuck.Resources.Languages {
/// <summary>
/// Looks up a localized string similar to Do you really want to proceed?.
/// </summary>
- public static string Dialog_AreYouSure_Title {
+ public static string Dialog_AreYouSure_Title {
+ get {
+ return ResourceManager.GetString("Dialog.AreYouSure.Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Deselect All.
+ /// </summary>
+ public static string DiskCleanup_Button_DeselectAll {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Button.DeselectAll", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Scan.
+ /// </summary>
+ public static string DiskCleanup_Button_Scan {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Button.Scan", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Select All.
+ /// </summary>
+ public static string DiskCleanup_Button_SelectAll {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Button.SelectAll", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Successfully freed {0} of disk space.
+ /// </summary>
+ public static string DiskCleanup_Complete_Message {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Complete.Message", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cleanup Complete.
+ /// </summary>
+ public static string DiskCleanup_Complete_Title {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Complete.Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Some files could not be deleted. They may be in use by another process..
+ /// </summary>
+ public static string DiskCleanup_Error_Message {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Error.Message", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cleanup Error.
+ /// </summary>
+ public static string DiskCleanup_Error_Title {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Error.Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Free up disk space by removing temporary files and cache.
+ /// </summary>
+ public static string DiskCleanup_Header_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Header.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Disk Cleanup.
+ /// </summary>
+ public static string DiskCleanup_Header_Title {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Header.Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Error Reports.
+ /// </summary>
+ public static string DiskCleanup_Item_ErrorReports {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.ErrorReports", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Windows error reports and crash dump files.
+ /// </summary>
+ public static string DiskCleanup_Item_ErrorReports_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.ErrorReports.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Prefetch Files.
+ /// </summary>
+ public static string DiskCleanup_Item_Prefetch {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.Prefetch", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Application prefetch data used to speed up loading.
+ /// </summary>
+ public static string DiskCleanup_Item_Prefetch_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.Prefetch.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Recycle Bin.
+ /// </summary>
+ public static string DiskCleanup_Item_RecycleBin {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.RecycleBin", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Deleted files still stored in the Recycle Bin.
+ /// </summary>
+ public static string DiskCleanup_Item_RecycleBin_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.RecycleBin.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to System Temp Files.
+ /// </summary>
+ public static string DiskCleanup_Item_SystemTemp {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.SystemTemp", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Windows system temporary files.
+ /// </summary>
+ public static string DiskCleanup_Item_SystemTemp_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.SystemTemp.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Temporary Files.
+ /// </summary>
+ public static string DiskCleanup_Item_TempFiles {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.TempFiles", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to User temporary files created by applications.
+ /// </summary>
+ public static string DiskCleanup_Item_TempFiles_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.TempFiles.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Thumbnail Cache.
+ /// </summary>
+ public static string DiskCleanup_Item_Thumbnails {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.Thumbnails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cached thumbnail images for Explorer file previews.
+ /// </summary>
+ public static string DiskCleanup_Item_Thumbnails_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.Thumbnails.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Windows Update Cache.
+ /// </summary>
+ public static string DiskCleanup_Item_WindowsUpdate {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.WindowsUpdate", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Downloaded Windows Update files that are no longer needed.
+ /// </summary>
+ public static string DiskCleanup_Item_WindowsUpdate_Description {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Item.WindowsUpdate.Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Loading cleanup items....
+ /// </summary>
+ public static string DiskCleanup_Loading {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Loading", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Scanning....
+ /// </summary>
+ public static string DiskCleanup_Scanning {
+ get {
+ return ResourceManager.GetString("DiskCleanup.Scanning", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Total reclaimable space.
+ /// </summary>
+ public static string DiskCleanup_TotalSpace {
get {
- return ResourceManager.GetString("Dialog.AreYouSure.Title", resourceCulture);
+ return ResourceManager.GetString("DiskCleanup.TotalSpace", resourceCulture);
}
}
@@ -2712,6 +3000,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Disk Cleanup.
+ /// </summary>
+ public static string Sidebar_DiskCleanup {
+ get {
+ return ResourceManager.GetString("Sidebar.DiskCleanup", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Optimize.
/// </summary>
@@ -2765,248 +3062,5 @@ namespace optimizerDuck.Resources.Languages {
return ResourceManager.GetString("Snackbar.OpenLinkFailed.Title", resourceCulture);
}
}
-
- /// <summary>
- /// Looks up a localized string similar to Disk Cleanup.
- /// </summary>
- public static string Sidebar_DiskCleanup {
- get {
- return ResourceManager.GetString("Sidebar.DiskCleanup", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Disk Cleanup.
- /// </summary>
- public static string DiskCleanup_Header_Title {
- get {
- return ResourceManager.GetString("DiskCleanup.Header.Title", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Free up disk space by removing temporary files and cache.
- /// </summary>
- public static string DiskCleanup_Header_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Header.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Total reclaimable space.
- /// </summary>
- public static string DiskCleanup_TotalSpace {
- get {
- return ResourceManager.GetString("DiskCleanup.TotalSpace", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Scan.
- /// </summary>
- public static string DiskCleanup_Button_Scan {
- get {
- return ResourceManager.GetString("DiskCleanup.Button.Scan", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Select All.
- /// </summary>
- public static string DiskCleanup_Button_SelectAll {
- get {
- return ResourceManager.GetString("DiskCleanup.Button.SelectAll", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Deselect All.
- /// </summary>
- public static string DiskCleanup_Button_DeselectAll {
- get {
- return ResourceManager.GetString("DiskCleanup.Button.DeselectAll", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Scanning....
- /// </summary>
- public static string DiskCleanup_Scanning {
- get {
- return ResourceManager.GetString("DiskCleanup.Scanning", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Loading cleanup items....
- /// </summary>
- public static string DiskCleanup_Loading {
- get {
- return ResourceManager.GetString("DiskCleanup.Loading", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Cleanup Complete.
- /// </summary>
- public static string DiskCleanup_Complete_Title {
- get {
- return ResourceManager.GetString("DiskCleanup.Complete.Title", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Successfully freed {0} of disk space.
- /// </summary>
- public static string DiskCleanup_Complete_Message {
- get {
- return ResourceManager.GetString("DiskCleanup.Complete.Message", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Cleanup Error.
- /// </summary>
- public static string DiskCleanup_Error_Title {
- get {
- return ResourceManager.GetString("DiskCleanup.Error.Title", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Some files could not be deleted. They may be in use by another process..
- /// </summary>
- public static string DiskCleanup_Error_Message {
- get {
- return ResourceManager.GetString("DiskCleanup.Error.Message", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Temporary Files.
- /// </summary>
- public static string DiskCleanup_Item_TempFiles {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.TempFiles", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to User temporary files created by applications.
- /// </summary>
- public static string DiskCleanup_Item_TempFiles_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.TempFiles.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to System Temp Files.
- /// </summary>
- public static string DiskCleanup_Item_SystemTemp {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.SystemTemp", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Windows system temporary files.
- /// </summary>
- public static string DiskCleanup_Item_SystemTemp_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.SystemTemp.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Windows Update Cache.
- /// </summary>
- public static string DiskCleanup_Item_WindowsUpdate {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.WindowsUpdate", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Downloaded Windows Update files that are no longer needed.
- /// </summary>
- public static string DiskCleanup_Item_WindowsUpdate_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.WindowsUpdate.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Prefetch Files.
- /// </summary>
- public static string DiskCleanup_Item_Prefetch {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.Prefetch", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Application prefetch data used to speed up loading.
- /// </summary>
- public static string DiskCleanup_Item_Prefetch_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.Prefetch.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Thumbnail Cache.
- /// </summary>
- public static string DiskCleanup_Item_Thumbnails {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.Thumbnails", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Cached thumbnail images for Explorer file previews.
- /// </summary>
- public static string DiskCleanup_Item_Thumbnails_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.Thumbnails.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Recycle Bin.
- /// </summary>
- public static string DiskCleanup_Item_RecycleBin {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.RecycleBin", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Deleted files still stored in the Recycle Bin.
- /// </summary>
- public static string DiskCleanup_Item_RecycleBin_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.RecycleBin.Description", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Error Reports.
- /// </summary>
- public static string DiskCleanup_Item_ErrorReports {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.ErrorReports", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Windows error reports and crash dump files.
- /// </summary>
- public static string DiskCleanup_Item_ErrorReports_Description {
- get {
- return ResourceManager.GetString("DiskCleanup.Item.ErrorReports.Description", resourceCulture);
- }
- }
}
}
diff --git a/optimizerDuck/Resources/Languages/Translations.resx b/optimizerDuck/Resources/Languages/Translations.resx
index 2faec22..d1f618c 100644
--- a/optimizerDuck/Resources/Languages/Translations.resx
+++ b/optimizerDuck/Resources/Languages/Translations.resx
@@ -1105,4 +1105,31 @@ Update now to enjoy the latest features, improvements, and bug fixes.</value>
<data name="DiskCleanup.Item.ErrorReports.Description" xml:space="preserve">
<value>Windows error reports and crash dump files</value>
</data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Laptop" xml:space="preserve">
+ <value>Laptop</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Desktop" xml:space="preserve">
+ <value>Desktop</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.Build" xml:space="preserve">
+ <value>Build {0}</value>
+ </data>
+ <data name="Bloatware.Header.Description" xml:space="preserve">
+ <value>Manage and remove pre-installed applications that you don't need</value>
+ </data>
+ <data name="Dashboard.Header.Description" xml:space="preserve">
+ <value>System overview and quick actions</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Header" xml:space="preserve">
+ <value>System Information</value>
+ </data>
+ <data name="DiskCleanup.ItemsSelected" xml:space="preserve">
+ <value>{0} ({1} items selected)</value>
+ </data>
+ <data name="DiskCleanup.Button.CleanSelected" xml:space="preserve">
+ <value>Clean Selected ({0})</value>
+ </data>
+ <data name="DiskCleanup.EmptySize" xml:space="preserve">
+ <value>Empty size</value>
+ </data>
</root>
\ No newline at end of file
diff --git a/optimizerDuck/Resources/Languages/Translations.ru-RU.resx b/optimizerDuck/Resources/Languages/Translations.ru-RU.resx
index 3b48ecf..544b5df 100644
--- a/optimizerDuck/Resources/Languages/Translations.ru-RU.resx
+++ b/optimizerDuck/Resources/Languages/Translations.ru-RU.resx
@@ -1105,4 +1105,31 @@
<data name="DiskCleanup.Item.ErrorReports.Description" xml:space="preserve">
<value>Отчёты об ошибках Windows и файлы аварийных дампов</value>
</data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Laptop" xml:space="preserve">
+ <value>Ноутбук</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Desktop" xml:space="preserve">
+ <value>Настольный ПК</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.Build" xml:space="preserve">
+ <value>Сборка {0}</value>
+ </data>
+ <data name="Bloatware.Header.Description" xml:space="preserve">
+ <value>Управление и удаление ненужных предустановленных приложений</value>
+ </data>
+ <data name="Dashboard.Header.Description" xml:space="preserve">
+ <value>Обзор системы и быстрые действия</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Header" xml:space="preserve">
+ <value>Информация о системе</value>
+ </data>
+ <data name="DiskCleanup.ItemsSelected" xml:space="preserve">
+ <value>{0} (выбрано элементов: {1})</value>
+ </data>
+ <data name="DiskCleanup.Button.CleanSelected" xml:space="preserve">
+ <value>Очистить выбранное ({0})</value>
+ </data>
+ <data name="DiskCleanup.EmptySize" xml:space="preserve">
+ <value>Пустой</value>
+ </data>
</root>
\ No newline at end of file
diff --git a/optimizerDuck/Resources/Languages/Translations.vi-VN.resx b/optimizerDuck/Resources/Languages/Translations.vi-VN.resx
index ab965d1..90d1cd1 100644
--- a/optimizerDuck/Resources/Languages/Translations.vi-VN.resx
+++ b/optimizerDuck/Resources/Languages/Translations.vi-VN.resx
@@ -1105,4 +1105,31 @@ Cập nhật ngay để trải nghiệm các tính năng mới, cải tiến và
<data name="DiskCleanup.Item.ErrorReports.Description" xml:space="preserve">
<value>Báo cáo lỗi Windows và tệp crash dump</value>
</data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Laptop" xml:space="preserve">
+ <value>Máy tính xách tay</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Desktop" xml:space="preserve">
+ <value>Máy tính để bàn</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.Build" xml:space="preserve">
+ <value>Bản dựng {0}</value>
+ </data>
+ <data name="Bloatware.Header.Description" xml:space="preserve">
+ <value>Quản lý và gỡ bỏ các ứng dụng cài sẵn không cần thiết</value>
+ </data>
+ <data name="Dashboard.Header.Description" xml:space="preserve">
+ <value>Tổng quan hệ thống và thao tác nhanh</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Header" xml:space="preserve">
+ <value>Thông tin hệ thống</value>
+ </data>
+ <data name="DiskCleanup.ItemsSelected" xml:space="preserve">
+ <value>{0} (đã chọn {1} mục)</value>
+ </data>
+ <data name="DiskCleanup.Button.CleanSelected" xml:space="preserve">
+ <value>Dọn dẹp đã chọn ({0})</value>
+ </data>
+ <data name="DiskCleanup.EmptySize" xml:space="preserve">
+ <value>Trống</value>
+ </data>
</root>
\ No newline at end of file
diff --git a/optimizerDuck/Resources/Languages/Translations.zh-Hans.resx b/optimizerDuck/Resources/Languages/Translations.zh-Hans.resx
index 286ae5d..84600ce 100644
--- a/optimizerDuck/Resources/Languages/Translations.zh-Hans.resx
+++ b/optimizerDuck/Resources/Languages/Translations.zh-Hans.resx
@@ -1051,5 +1051,23 @@
<data name="DiskCleanup.Item.ErrorReports.Description" xml:space="preserve">
<value>Windows 错误报告和崩溃转储文件</value>
</data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Laptop" xml:space="preserve">
+ <value>笔记本电脑</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.DeviceType.Desktop" xml:space="preserve">
+ <value>台式电脑</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Os.Build" xml:space="preserve">
+ <value>内部版本 {0}</value>
+ </data>
+ <data name="Bloatware.Header.Description" xml:space="preserve">
+ <value>管理和卸载不需要的预装应用程序</value>
+ </data>
+ <data name="Dashboard.Header.Description" xml:space="preserve">
+ <value>系统概览与快速操作</value>
+ </data>
+ <data name="Dashboard.SystemInfo.Header" xml:space="preserve">
+ <value>系统信息</value>
+ </data>
</root>
diff --git a/optimizerDuck/Services/DiskCleanupService.cs b/optimizerDuck/Services/DiskCleanupService.cs
index 4bc4170..8dcb7fe 100644
--- a/optimizerDuck/Services/DiskCleanupService.cs
+++ b/optimizerDuck/Services/DiskCleanupService.cs
@@ -102,7 +102,6 @@ public class DiskCleanupService(ILogger<DiskCleanupService> logger)
}
item.IsScanned = true;
- logger.LogInformation("Scanned {ItemId}: {Size}", item.Id, item.FormattedSize);
}
catch (Exception ex)
{
@@ -118,8 +117,7 @@ public class DiskCleanupService(ILogger<DiskCleanupService> logger)
public async Task ScanAllAsync(IEnumerable<CleanupItem> items)
{
- foreach (var item in items)
- await ScanAsync(item);
+ await Task.WhenAll(items.Select(ScanAsync));
}
public async Task<long> CleanAsync(CleanupItem item)
@@ -286,4 +284,4 @@ public class DiskCleanupService(ILogger<DiskCleanupService> logger)
return freed;
}
-}
+}
\ No newline at end of file
diff --git a/optimizerDuck/Services/SystemInfoService.cs b/optimizerDuck/Services/SystemInfoService.cs
index 7878ea3..fd200b8 100644
--- a/optimizerDuck/Services/SystemInfoService.cs
+++ b/optimizerDuck/Services/SystemInfoService.cs
@@ -793,13 +793,13 @@ internal static class OsProvider
switch (type)
{
case 8 or 9 or 10 or 11 or 14 or 30 or 31 or 32:
- return "Laptop";
+ return Translations.Dashboard_SystemInfo_Os_DeviceType_Laptop;
case >= 1 and <= 7 or 12 or 13 or >= 15 and <= 29 or >= 33 and <= 36:
- return "Desktop";
+ return Translations.Dashboard_SystemInfo_Os_DeviceType_Desktop;
}
- return "Unknown";
+ return Translations.Common_Unknown;
}
private static string FormatWmiDate(string wmiDate)
diff --git a/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
index d2eaa2b..f8564dd 100644
--- a/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
@@ -51,8 +51,6 @@ public partial class DiskCleanupViewModel(
UpdateProperties();
};
}
-
- UpdateProperties();
}
catch (Exception ex)
{
@@ -61,6 +59,7 @@ public partial class DiskCleanupViewModel(
finally
{
IsLoading = false;
+ UpdateProperties();
}
// Automatically start scanning
@@ -76,7 +75,6 @@ public partial class DiskCleanupViewModel(
try
{
await diskCleanupService.ScanAllAsync(CleanupItems);
- UpdateProperties();
}
catch (Exception ex)
{
@@ -85,6 +83,7 @@ public partial class DiskCleanupViewModel(
finally
{
IsScanning = false;
+ UpdateProperties();
}
}
@@ -97,7 +96,10 @@ public partial class DiskCleanupViewModel(
try
{
var freedBytes = await diskCleanupService.CleanSelectedAsync(CleanupItems);
- UpdateProperties();
+
+ // Deselect all items after successful clean
+ foreach (var item in CleanupItems)
+ item.IsSelected = false;
snackbarService.Show(
Translations.DiskCleanup_Complete_Title,
@@ -121,6 +123,7 @@ public partial class DiskCleanupViewModel(
finally
{
IsCleaning = false;
+ UpdateProperties();
}
}
@@ -145,4 +148,4 @@ public partial class DiskCleanupViewModel(
OnPropertyChanged(nameof(CanClean));
OnPropertyChanged(nameof(IsAllSelected));
}
-}
+}
\ No newline at end of file
diff --git a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml
index 6660fef..4cf4594 100644
--- a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml
+++ b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml
@@ -27,11 +27,18 @@
</Page.Resources>
<Grid RowDefinitions="Auto *">
- <ui:TextBlock
- FontTypography="Title"
- Margin="0,0,0,20"
- Text="{ext:Loc Bloatware.Header.Title}"
- TextWrapping="Wrap" />
+ <StackPanel Margin="0,0,0,20">
+ <ui:TextBlock
+ FontTypography="Title"
+ Text="{ext:Loc Bloatware.Header.Title}"
+ TextWrapping="Wrap" />
+ <ui:TextBlock
+ Margin="0,4,0,0"
+ Appearance="Secondary"
+ FontTypography="Body"
+ Text="{ext:Loc Bloatware.Header.Description}"
+ TextWrapping="Wrap" />
+ </StackPanel>
<!-- Empty (truly no packages installed) -->
<Border Grid.Row="1">
diff --git a/optimizerDuck/UI/Views/Pages/DashboardPage.xaml b/optimizerDuck/UI/Views/Pages/DashboardPage.xaml
index 19a9e92..741355e 100644
--- a/optimizerDuck/UI/Views/Pages/DashboardPage.xaml
+++ b/optimizerDuck/UI/Views/Pages/DashboardPage.xaml
@@ -57,10 +57,10 @@
{Binding ViewModel.LatestVersion}}"
Severity="Warning" />
<Grid ColumnDefinitions="*,Auto">
- <ui:TextBlock
- FontTypography="Title"
- Text="{ext:Loc Dashboard.Header.Title}"
- TextWrapping="Wrap" />
+ <ui:TextBlock
+ FontTypography="Title"
+ Text="{ext:Loc Dashboard.Header.Title}"
+ TextWrapping="Wrap" />
<Menu Grid.Column="1">
<ui:MenuItem Header="{ext:Loc Dashboard.Header.Menu.Header.Options}">
@@ -192,7 +192,7 @@
CornerRadius="4"
Margin="0,0,4,4"
Padding="6,3">
- <ui:TextBlock FontTypography="Caption" Text="{Binding ViewModel.SystemInfo.Os.BuildNumber, StringFormat='{}Build {0}'}" />
+ <ui:TextBlock FontTypography="Caption" Text="{ext:Loc Dashboard.SystemInfo.Os.Build, {Binding ViewModel.SystemInfo.Os.BuildNumber}}" />
</Border>
<Border
Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"
@@ -201,6 +201,13 @@
Padding="6,3">
<ui:TextBlock FontTypography="Caption" Text="{Binding ViewModel.SystemInfo.Os.DeviceType}" />
</Border>
+ <Border
+ Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"
+ CornerRadius="4"
+ Margin="0,0,4,4"
+ Padding="6,3">
+ <ui:TextBlock FontTypography="Caption" Text="{Binding ViewModel.SystemInfo.Os.InstallDate}" />
+ </Border>
</WrapPanel>
</Grid>
</ui:CardControl.Header>
@@ -386,8 +393,8 @@
</UniformGrid>
<!-- Storage Section -->
- <ui:TextBlock
- FontTypography="BodyStrong"
+ <ui:TextBlock
+ FontTypography="BodyStrong"
Margin="0,20,0,8"
Text="{ext:Loc Dashboard.SystemInfo.Storage.Header}" />
diff --git a/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml b/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml
index d0a8fa7..8ca7685 100644
--- a/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml
+++ b/optimizerDuck/UI/Views/Pages/DiskCleanupPage.xaml
@@ -1,16 +1,7 @@
<Page
- Foreground="{DynamicResource TextFillColorPrimaryBrush}"
- Margin="0,32,0,0"
- ScrollViewer.CanContentScroll="False"
- Title="DiskCleanupPage"
- d:DataContext="{d:DesignInstance local:DiskCleanupPage}"
- d:DesignHeight="1200"
- d:DesignWidth="800"
- mc:Ignorable="d"
- ui:Design.Background="Black"
- ui:Design.Foreground="White"
x:Class="optimizerDuck.UI.Views.Pages.DiskCleanupPage"
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:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -18,260 +9,343 @@
xmlns:local="clr-namespace:optimizerDuck.UI.Views.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ Title="DiskCleanupPage"
+ Margin="0,32,0,0"
+ d:DataContext="{d:DesignInstance local:DiskCleanupPage}"
+ d:DesignHeight="1200"
+ d:DesignWidth="800"
+ ui:Design.Background="Black"
+ ui:Design.Foreground="White"
+ Foreground="{DynamicResource TextFillColorPrimaryBrush}"
+ ScrollViewer.CanContentScroll="False"
+ mc:Ignorable="d">
<Page.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:GreaterThanZeroToVisibilityConverter x:Key="GreaterThanZeroToVisibilityConverter" />
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
+ <converters:SizeToBrushConverter x:Key="SizeToBrushConverter" />
</Page.Resources>
<Grid RowDefinitions="Auto *">
- <!-- Header -->
+ <!-- Header -->
<StackPanel Margin="0,0,0,20">
<ui:TextBlock
FontTypography="Title"
Text="{ext:Loc DiskCleanup.Header.Title}"
TextWrapping="Wrap" />
<ui:TextBlock
+ Margin="0,4,0,0"
Appearance="Secondary"
FontTypography="Body"
- Margin="0,4,0,0"
Text="{ext:Loc DiskCleanup.Header.Description}"
TextWrapping="Wrap" />
</StackPanel>
- <!-- Loading -->
+ <!-- Loading state (initial scan) -->
<Border Grid.Row="1" Visibility="{Binding ViewModel.IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}">
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <StackPanel
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Orientation="Vertical">
+ <ui:SymbolIcon
+ Margin="0,0,0,16"
+ HorizontalAlignment="Center"
+ FontSize="48"
+ Foreground="{DynamicResource TextFillColorSecondaryBrush}"
+ Symbol="HardDrive20" />
<ui:ProgressRing
+ Width="36"
+ Height="36"
+ Margin="0,0,0,12"
HorizontalAlignment="Center"
- IsIndeterminate="True"
- Margin="0,0,0,5"
- VerticalAlignment="Center" />
+ IsIndeterminate="True" />
<ui:TextBlock
+ HorizontalAlignment="Center"
FontTypography="BodyStrong"
+ Text="{ext:Loc DiskCleanup.Loading}" />
+ <ui:TextBlock
+ Margin="0,4,0,0"
HorizontalAlignment="Center"
- Text="{ext:Loc DiskCleanup.Loading}"
- VerticalAlignment="Center" />
+ Appearance="Secondary"
+ FontTypography="Caption"
+ Text="{ext:Loc DiskCleanup.Header.Description}" />
</StackPanel>
</Border>
- <!-- Main content -->
- <Border
- Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"
- CornerRadius="6"
+ <!-- Main content -->
+ <Grid
Grid.Row="1"
- Padding="8"
+ RowDefinitions="Auto,Auto,*"
Visibility="{Binding ViewModel.HasData, Converter={StaticResource BooleanToVisibilityConverter}}">
- <Grid RowDefinitions="Auto,Auto,*">
- <!-- Summary card -->
- <ui:CardControl
- Grid.Row="0"
- Icon="{ui:SymbolIcon HardDrive20}"
- Margin="0,0,0,8">
- <ui:CardControl.Header>
- <StackPanel>
- <ui:TextBlock
- Appearance="Primary"
- FontTypography="BodyStrong"
- Text="{ext:Loc DiskCleanup.TotalSpace}" />
- <ui:TextBlock
- Appearance="Secondary"
- FontTypography="Body">
- <ui:TextBlock.Text>
- <MultiBinding StringFormat="{}{0} ({1} items selected)">
- <Binding Path="ViewModel.TotalSelectedSizeFormatted" />
- <Binding Path="ViewModel.SelectedCount" />
- </MultiBinding>
- </ui:TextBlock.Text>
- </ui:TextBlock>
- </StackPanel>
- </ui:CardControl.Header>
- </ui:CardControl>
+ <!-- Summary card -->
+ <Border
+ Margin="0,0,0,12"
+ Padding="16"
+ Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"
+ CornerRadius="8">
+ <Grid ColumnDefinitions="Auto,*,Auto">
+ <!-- Icon -->
+ <Border
+ Width="44"
+ Height="44"
+ Margin="0,0,16,0"
+ VerticalAlignment="Center"
+ CornerRadius="22">
+ <ui:SymbolIcon
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ FontSize="22"
+ Foreground="White"
+ Symbol="HardDrive20" />
+ </Border>
- <!-- Action buttons -->
- <StackPanel
- Grid.Row="1"
- Margin="0,0,0,8"
- Orientation="Horizontal">
+ <!-- Info -->
+ <StackPanel Grid.Column="1" VerticalAlignment="Center">
+ <ui:TextBlock FontTypography="BodyStrong" Text="{ext:Loc DiskCleanup.TotalSpace}" />
+ <ui:TextBlock
+ Margin="0,2,0,0"
+ Appearance="Secondary"
+ FontTypography="Body"
+ Text="{ext:Loc DiskCleanup.ItemsSelected,
+ {Binding ViewModel.TotalSelectedSizeFormatted},
+ {Binding ViewModel.SelectedCount}}" />
+ </StackPanel>
- <!-- Scan button -->
- <ui:Button
- Appearance="Primary"
- Command="{Binding ViewModel.ScanCommand}"
- Content="{ext:Loc DiskCleanup.Button.Scan}"
- Icon="{ui:SymbolIcon Search24,
- FontSize=18}"
- IsEnabled="{Binding ViewModel.IsScanning, Converter={StaticResource InverseBooleanConverter}}" />
+ <!-- Scanning indicator in summary -->
+ <StackPanel
+ Grid.Column="2"
+ VerticalAlignment="Center"
+ Orientation="Horizontal"
+ Visibility="{Binding ViewModel.IsScanning, Converter={StaticResource BooleanToVisibilityConverter}}">
+ <ui:ProgressRing
+ Width="16"
+ Height="16"
+ Margin="0,0,8,0"
+ IsIndeterminate="True" />
+ <ui:TextBlock
+ VerticalAlignment="Center"
+ Appearance="Secondary"
+ FontTypography="Caption"
+ Text="{ext:Loc DiskCleanup.Scanning}" />
+ </StackPanel>
+ </Grid>
+ </Border>
- <Separator Margin="3,0,3,0" />
+ <!-- Action buttons -->
+ <StackPanel
+ Grid.Row="1"
+ Margin="0,0,0,12"
+ Orientation="Horizontal">
- <!-- Clean button -->
- <ui:Button
- Appearance="Danger"
- Command="{Binding ViewModel.CleanSelectedCommand}"
- IsEnabled="{Binding ViewModel.CanClean}">
- <ui:Button.Content>
- <StackPanel Orientation="Horizontal">
- <ui:SymbolIcon FontSize="18" Margin="0,0,6,0" Symbol="Delete24" />
- <TextBlock>
- <TextBlock.Text>
- <MultiBinding StringFormat="{}Clean Selected ({0})">
- <Binding Path="ViewModel.TotalSelectedSizeFormatted" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- </StackPanel>
- </ui:Button.Content>
- </ui:Button>
+ <!-- Scan button -->
+ <ui:Button
+ Appearance="Primary"
+ Command="{Binding ViewModel.ScanCommand}"
+ Content="{ext:Loc DiskCleanup.Button.Scan}"
+ Icon="{ui:SymbolIcon Search24,
+ FontSize=18}"
+ IsEnabled="{Binding ViewModel.IsScanning, Converter={StaticResource InverseBooleanConverter}}" />
- <Separator Margin="3,0,3,0" />
+ <Separator Margin="4,0,4,0" />
- <!-- Select/Deselect All -->
- <ui:Button Command="{Binding ViewModel.SelectAllCommand}">
- <ui:Button.Style>
- <Style BasedOn="{StaticResource {x:Type ui:Button}}" TargetType="ui:Button">
- <Setter Property="Appearance" Value="Success" />
- <Setter Property="Content" Value="{ext:Loc DiskCleanup.Button.SelectAll}" />
- <Setter Property="Icon">
- <Setter.Value>
- <ui:SymbolIcon FontSize="18" Symbol="CheckboxChecked24" />
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding ViewModel.IsAllSelected}" Value="True">
- <Setter Property="Appearance" Value="Caution" />
- <Setter Property="Content" Value="{ext:Loc DiskCleanup.Button.DeselectAll}" />
- <Setter Property="Icon">
- <Setter.Value>
- <ui:SymbolIcon FontSize="18" Symbol="CheckboxUnchecked24" />
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </ui:Button.Style>
- </ui:Button>
- </StackPanel>
+ <!-- Clean button -->
+ <ui:Button
+ Appearance="Danger"
+ Command="{Binding ViewModel.CleanSelectedCommand}"
+ IsEnabled="{Binding ViewModel.CanClean}">
+ <ui:Button.Content>
+ <StackPanel Orientation="Horizontal">
+ <ui:SymbolIcon
+ Margin="0,0,6,0"
+ FontSize="18"
+ Symbol="Delete24" />
+ <TextBlock Text="{ext:Loc DiskCleanup.Button.CleanSelected, {Binding ViewModel.TotalSelectedSizeFormatted}}" />
+ </StackPanel>
+ </ui:Button.Content>
+ </ui:Button>
- <!-- Scanning indicator -->
- <StackPanel
- Grid.Row="2"
- HorizontalAlignment="Center"
- Orientation="Horizontal"
- VerticalAlignment="Top"
- Margin="0,0,0,8"
- Visibility="{Binding ViewModel.IsScanning, Converter={StaticResource BooleanToVisibilityConverter}}">
- <ui:ProgressRing
- Height="16"
- IsIndeterminate="True"
- Margin="0,0,8,0"
- Width="16" />
- <ui:TextBlock
- Appearance="Secondary"
- FontTypography="Caption"
- Text="{ext:Loc DiskCleanup.Scanning}" />
- </StackPanel>
+ <Separator Margin="4,0,4,0" />
- <!-- Items list -->
- <ScrollViewer
- Grid.Row="2"
- HorizontalScrollBarVisibility="Disabled"
- Margin="0,28,0,0"
- VerticalScrollBarVisibility="Auto">
- <ItemsControl ItemsSource="{Binding ViewModel.CleanupItems}">
- <ItemsControl.ItemTemplate>
- <DataTemplate DataType="{x:Type cleanup:CleanupItem}">
- <Border
- Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"
- CornerRadius="6"
- Margin="0,0,0,4"
- Padding="12">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
+ <!-- Select/Deselect All -->
+ <ui:Button Command="{Binding ViewModel.SelectAllCommand}">
+ <ui:Button.Style>
+ <Style BasedOn="{StaticResource {x:Type ui:Button}}" TargetType="ui:Button">
+ <Setter Property="Appearance" Value="Success" />
+ <Setter Property="Content" Value="{ext:Loc DiskCleanup.Button.SelectAll}" />
+ <Setter Property="Icon">
+ <Setter.Value>
+ <ui:SymbolIcon FontSize="18" Symbol="CheckboxChecked24" />
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding ViewModel.IsAllSelected}" Value="True">
+ <Setter Property="Appearance" Value="Caution" />
+ <Setter Property="Content" Value="{ext:Loc DiskCleanup.Button.DeselectAll}" />
+ <Setter Property="Icon">
+ <Setter.Value>
+ <ui:SymbolIcon FontSize="18" Symbol="CheckboxUnchecked24" />
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ui:Button.Style>
+ </ui:Button>
+ </StackPanel>
- <!-- Checkbox -->
- <CheckBox
- Grid.Column="0"
- IsChecked="{Binding IsSelected, Mode=TwoWay}"
- Margin="0,4,12,0"
- VerticalAlignment="Top" />
+ <!-- Items list (virtualized) -->
+ <ui:VirtualizingItemsControl Grid.Row="2" ItemsSource="{Binding ViewModel.CleanupItems}">
+ <ui:VirtualizingItemsControl.Template>
+ <ControlTemplate TargetType="ItemsControl">
+ <ScrollViewer HorizontalScrollBarVisibility="Disabled">
+ <ItemsPresenter />
+ </ScrollViewer>
+ </ControlTemplate>
+ </ui:VirtualizingItemsControl.Template>
+ <ui:VirtualizingItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <VirtualizingStackPanel />
+ </ItemsPanelTemplate>
+ </ui:VirtualizingItemsControl.ItemsPanel>
+ <ui:VirtualizingItemsControl.ItemTemplate>
+ <DataTemplate DataType="{x:Type cleanup:CleanupItem}">
+ <Border
+ Margin="0,0,0,4"
+ Padding="14"
+ Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"
+ CornerRadius="8">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
- <!-- Icon -->
- <ui:SymbolIcon
- FontSize="24"
- Grid.Column="1"
- Margin="0,4,12,0"
- Symbol="{Binding Icon}"
- VerticalAlignment="Top" />
+ <!-- Checkbox -->
+ <CheckBox
+ Grid.Column="0"
+ Margin="0,0,12,0"
+ VerticalAlignment="Center"
+ IsChecked="{Binding IsSelected, Mode=TwoWay}" />
- <!-- Info -->
- <StackPanel Grid.Column="2">
- <ui:TextBlock FontTypography="BodyStrong" Text="{Binding Name}" />
- <ui:TextBlock
- Appearance="Disabled"
- FontTypography="Body"
- Margin="0,2,0,0"
- Text="{Binding Description}"
- TextWrapping="Wrap" />
- <ui:TextBlock
- Appearance="Secondary"
- FontTypography="Caption"
- Margin="0,2,0,0"
- Text="{Binding Path}"
- TextTrimming="CharacterEllipsis" />
- </StackPanel>
+ <!-- Icon with circle background -->
+ <Border
+ Grid.Column="1"
+ Width="38"
+ Height="38"
+ Margin="0,0,14,0"
+ VerticalAlignment="Center"
+ Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"
+ CornerRadius="19">
+ <ui:SymbolIcon
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ FontSize="20"
+ Foreground="{DynamicResource TextFillColorSecondaryBrush}"
+ Symbol="{Binding Icon}" />
+ </Border>
- <!-- Size / Status indicator -->
- <StackPanel
- Grid.Column="3"
- HorizontalAlignment="Right"
- Margin="12,0,0,0"
- VerticalAlignment="Center">
- <!-- Scanning spinner -->
- <ui:ProgressRing
- Height="20"
- IsIndeterminate="True"
- Visibility="{Binding IsScanning, Converter={StaticResource BooleanToVisibilityConverter}}"
- Width="20" />
- <!-- Cleaning spinner -->
- <ui:ProgressRing
- Height="20"
- IsIndeterminate="True"
- Visibility="{Binding IsCleaning, Converter={StaticResource BooleanToVisibilityConverter}}"
- Width="20" />
- <!-- Size display -->
- <ui:TextBlock
- FontTypography="BodyStrong"
- Text="{Binding FormattedSize}"
- Visibility="{Binding IsScanned, Converter={StaticResource BooleanToVisibilityConverter}}">
- <ui:TextBlock.Style>
- <Style BasedOn="{StaticResource {x:Type ui:TextBlock}}" TargetType="ui:TextBlock">
+ <!-- Info -->
+ <StackPanel Grid.Column="2" VerticalAlignment="Center">
+ <ui:TextBlock FontTypography="BodyStrong" Text="{Binding Name}" />
+ <ui:TextBlock
+ Margin="0,2,0,0"
+ Appearance="Disabled"
+ FontTypography="Body"
+ Text="{Binding Description}"
+ TextWrapping="Wrap" />
+ <ui:TextBlock
+ Margin="0,2,0,0"
+ Appearance="Secondary"
+ FontTypography="Caption"
+ Text="{Binding Path}"
+ TextTrimming="CharacterEllipsis" />
+
+ <Border
+ Margin="0,6,0,0"
+ HorizontalAlignment="Left"
+ CornerRadius="10">
+ <Border.Style>
+ <Style TargetType="Border">
+ <Setter Property="Visibility" Value="{Binding IsScanned, Converter={StaticResource BooleanToVisibilityConverter}}" />
+ <Setter Property="Padding" Value="8,3" />
+ <Setter Property="Background" Value="{Binding SizeBytes, Converter={StaticResource SizeToBrushConverter}}" />
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsScanning}" Value="True">
+ <Setter Property="Visibility" Value="Collapsed" />
+ </DataTrigger>
+ <DataTrigger Binding="{Binding IsCleaning}" Value="True">
+ <Setter Property="Visibility" Value="Collapsed" />
+ </DataTrigger>
+ <DataTrigger Binding="{Binding FormattedSize}" Value="0 B">
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Padding" Value="0,3" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Border.Style>
+ <Grid>
+ <Border>
+ <Border.Style>
+ <Style TargetType="Border">
+ <Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
- <DataTrigger Binding="{Binding IsScanning}" Value="True">
+ <DataTrigger Binding="{Binding FormattedSize}" Value="0 B">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
- <DataTrigger Binding="{Binding IsCleaning}" Value="True">
- <Setter Property="Visibility" Value="Collapsed" />
+ </Style.Triggers>
+ </Style>
+ </Border.Style>
+ <ui:TextBlock
+ FontTypography="Caption"
+ Foreground="{DynamicResource TextFillColorInverseBrush}"
+ Text="{Binding FormattedSize}" />
+ </Border>
+ <Border>
+ <Border.Style>
+ <Style TargetType="Border">
+ <Setter Property="Visibility" Value="Collapsed" />
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding FormattedSize}" Value="0 B">
+ <Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
- </ui:TextBlock.Style>
- </ui:TextBlock>
- </StackPanel>
- </Grid>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </Border>
+ </Border.Style>
+ <ui:TextBlock
+ FontTypography="Caption"
+ Foreground="{DynamicResource TextFillColorSecondaryBrush}"
+ Text="{ext:Loc DiskCleanup.EmptySize}" />
+ </Border>
+
+ </Grid>
+ </Border>
+ </StackPanel>
+
+ <!-- Scanning / Cleaning spinners -->
+ <StackPanel
+ Grid.Column="3"
+ Margin="14,0,0,0"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Center">
+ <ui:ProgressRing
+ Width="22"
+ Height="22"
+ IsIndeterminate="True"
+ Visibility="{Binding IsScanning, Converter={StaticResource BooleanToVisibilityConverter}}" />
+ <ui:ProgressRing
+ Width="22"
+ Height="22"
+ IsIndeterminate="True"
+ Visibility="{Binding IsCleaning, Converter={StaticResource BooleanToVisibilityConverter}}" />
+ </StackPanel>
+ </Grid>
+ </Border>
+ </DataTemplate>
+ </ui:VirtualizingItemsControl.ItemTemplate>
+ </ui:VirtualizingItemsControl>
+ </Grid>
</Grid>
-</Page>
+</Page>
\ No newline at end of file