Free, open-source Windows optimization tool for performance, privacy, and simplicity.
C# csharpdebloatdotnetgamingopen-sourceoptimizationoptimizeroptimizerduckperformanceprivacytweakertweakswindowswinui
feat: finish
itsfatduck78c0af0391fc
diff --git a/optimizerDuck/Common/Helpers/Converters/EmptyWhileNotLoadingConverter.cs b/optimizerDuck/Common/Helpers/Converters/EmptyWhileNotLoadingConverter.csnew file mode 100644index 0000000..2d8448c--- /dev/null+++ b/optimizerDuck/Common/Helpers/Converters/EmptyWhileNotLoadingConverter.cs@@ -0,0 +1,25 @@+using System.Globalization;+using System.Windows;+using System.Windows.Data;++namespace optimizerDuck.Common.Helpers.Converters;++public class EmptyWhileNotLoadingConverter : IMultiValueConverter+{+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)+ {+ if (values.Length < 2) return Visibility.Collapsed;++ if (values[0] is int count && values[1] is bool isLoading)+ {+ return (count == 0 && !isLoading)+ ? Visibility.Visible+ : Visibility.Collapsed;+ }++ return Visibility.Collapsed;+ }++ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)+ => throw new NotSupportedException();+}diff --git a/optimizerDuck/Resources/Languages/Translations.Designer.cs b/optimizerDuck/Resources/Languages/Translations.Designer.csindex ba59132..46423fd 100644--- a/optimizerDuck/Resources/Languages/Translations.Designer.cs+++ b/optimizerDuck/Resources/Languages/Translations.Designer.cs@@ -59,6 +59,60 @@ namespace optimizerDuck.Resources.Languages {}}+ /// <summary>+ /// Looks up a localized string similar to optimizerDuck didn't find any removable AppX packages. Everything looks quite good..+ /// </summary>+ public static string Bloatware_Empty_Description {+ get {+ return ResourceManager.GetString("Bloatware.Empty.Description", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to No unnecessary apps found.+ /// </summary>+ public static string Bloatware_Empty_Title {+ get {+ return ResourceManager.GetString("Bloatware.Empty.Title", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Bloatware.+ /// </summary>+ public static string Bloatware_Header_Title {+ get {+ return ResourceManager.GetString("Bloatware.Header.Title", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Looking for removable apps….+ /// </summary>+ public static string Bloatware_Loading {+ get {+ return ResourceManager.GetString("Bloatware.Loading", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Refresh.+ /// </summary>+ public static string Bloatware_Menu_Refresh {+ get {+ return ResourceManager.GetString("Bloatware.Menu.Refresh", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Remove ({0}).+ /// </summary>+ public static string Bloatware_Menu_Remove {+ get {+ return ResourceManager.GetString("Bloatware.Menu.Remove", resourceCulture);+ }+ }+/// <summary>/// Looks up a localized string similar to Removing {0} ({1}/{2})./// </summary>diff --git a/optimizerDuck/Resources/Languages/Translations.resx b/optimizerDuck/Resources/Languages/Translations.resxindex ec8b9ef..89f779b 100644--- a/optimizerDuck/Resources/Languages/Translations.resx+++ b/optimizerDuck/Resources/Languages/Translations.resx@@ -806,4 +806,22 @@ Current version: {0}]]></value><data name="BloatwareDialog.Removing" xml:space="preserve"><value>Removing {0} ({1}/{2})</value></data>+ <data name="Bloatware.Header.Title" xml:space="preserve">+ <value>Bloatware</value>+ </data>+ <data name="Bloatware.Menu.Remove" xml:space="preserve">+ <value>Remove ({0})</value>+ </data>+ <data name="Bloatware.Menu.Refresh" xml:space="preserve">+ <value>Refresh</value>+ </data>+ <data name="Bloatware.Empty.Title" xml:space="preserve">+ <value>No unnecessary apps found</value>+ </data>+ <data name="Bloatware.Empty.Description" xml:space="preserve">+ <value>optimizerDuck didn't find any removable AppX packages. Everything looks quite good.</value>+ </data>+ <data name="Bloatware.Loading" xml:space="preserve">+ <value>Looking for removable apps…</value>+ </data></root>\ No newline at end of filediff --git a/optimizerDuck/Resources/Languages/Translations.ru-RU.resx b/optimizerDuck/Resources/Languages/Translations.ru-RU.resxindex 31fe3bc..8874451 100644--- a/optimizerDuck/Resources/Languages/Translations.ru-RU.resx+++ b/optimizerDuck/Resources/Languages/Translations.ru-RU.resx@@ -842,4 +842,28 @@<data name="RestorePoint.Snackbar.Error.Message" xml:space="preserve"><value>Ошибка при создании или включении восстановления системы, попробуйте создать вручную.</value></data>+ <data name="BloatwareDialog.Title" xml:space="preserve">+ <value>Удаление {0} пакетов AppX</value>+ </data>+ <data name="BloatwareDialog.Removing" xml:space="preserve">+ <value>Удаление {0} ({1}/{2})</value>+ </data>+ <data name="Bloatware.Header.Title" xml:space="preserve">+ <value>Bloatware</value>+ </data>+ <data name="Bloatware.Menu.Remove" xml:space="preserve">+ <value>Удалить ({0})</value>+ </data>+ <data name="Bloatware.Menu.Refresh" xml:space="preserve">+ <value>Обновить</value>+ </data>+ <data name="Bloatware.Empty.Title" xml:space="preserve">+ <value>Не найдено ненужных приложений</value>+ </data>+ <data name="Bloatware.Empty.Description" xml:space="preserve">+ <value>optimizerDuck не нашёл удаляемых пакетов AppX. Всё выглядит хорошо.</value>+ </data>+ <data name="Bloatware.Loading" xml:space="preserve">+ <value>Поиск удаляемых приложений…</value>+ </data></root>diff --git a/optimizerDuck/Resources/Languages/Translations.vi-vn.resx b/optimizerDuck/Resources/Languages/Translations.vi-vn.resxindex 402c1b5..05e06bd 100644--- a/optimizerDuck/Resources/Languages/Translations.vi-vn.resx+++ b/optimizerDuck/Resources/Languages/Translations.vi-vn.resx@@ -723,12 +723,13 @@<value>Tắt hoạt ảnh taskbar, bóng đổ, độ trong suốt và Aero Peek để có hiệu suất tốt hơn.</value></data><data name="Settings.Optimize.ShellTimeout.Warning" xml:space="preserve">- <value>Đừng thay đổi nếu bạn không thực sự biết mình đang làm gì</value>+ <value>ĐỪNG thay đổi trừ khi bạn biết chính xác mình đang làm gì</value></data><data name="Optimizer.PowerManagement.InstallOptimizerDuckPowerPlan.Error.DownloadFailed" xml:space="preserve">- <value>Không thể tải power plan của optimizerDuck.</value>+ <value>Không thể tải xuống power plan của optimizerDuck.</value></data><data name="Settings.About.Acknowledgements.Title" xml:space="preserve">+ <value>Cảm ơn</value><value>Ghi nhận (Acknowledgments)</value></data><data name="Settings.About.Acknowledgements.Description" xml:space="preserve">@@ -795,4 +796,28 @@<data name="Button.ViewLatestRelease" xml:space="preserve"><value>Xem bản phát hành mới nhất</value></data>+ <data name="BloatwareDialog.Title" xml:space="preserve">+ <value>Đang gỡ {0} Gói AppX</value>+ </data>+ <data name="BloatwareDialog.Removing" xml:space="preserve">+ <value>Đang gỡ {0} ({1}/{2})</value>+ </data>+ <data name="Bloatware.Header.Title" xml:space="preserve">+ <value>Bloatware</value>+ </data>+ <data name="Bloatware.Menu.Remove" xml:space="preserve">+ <value>Gỡ ({0})</value>+ </data>+ <data name="Bloatware.Menu.Refresh" xml:space="preserve">+ <value>Làm mới</value>+ </data>+ <data name="Bloatware.Empty.Title" xml:space="preserve">+ <value>Không tìm thấy ứng dụng không cần thiết</value>+ </data>+ <data name="Bloatware.Empty.Description" xml:space="preserve">+ <value>optimizerDuck không tìm thấy gói AppX nào có thể gỡ. Mọi thứ trông ổn.</value>+ </data>+ <data name="Bloatware.Loading" xml:space="preserve">+ <value>Đang tìm kiếm ứng dụng có thể gỡ…</value>+ </data></root>\ No newline at end of filediff --git a/optimizerDuck/Resources/Languages/Translations.zh-Hans-CN.resx b/optimizerDuck/Resources/Languages/Translations.zh-Hans-CN.resxindex 065fa98..1886251 100644--- a/optimizerDuck/Resources/Languages/Translations.zh-Hans-CN.resx+++ b/optimizerDuck/Resources/Languages/Translations.zh-Hans-CN.resx@@ -842,4 +842,28 @@<data name="RestorePoint.Snackbar.Error.Message" xml:space="preserve"><value>创建或启用系统还原时出错,请尝试手动创建。</value></data>+ <data name="BloatwareDialog.Title" xml:space="preserve">+ <value>正在移除 {0} 个 AppX 包</value>+ </data>+ <data name="BloatwareDialog.Removing" xml:space="preserve">+ <value>正在移除 {0} ({1}/{2})</value>+ </data>+ <data name="Bloatware.Header.Title" xml:space="preserve">+ <value>臃肿软件</value>+ </data>+ <data name="Bloatware.Menu.Remove" xml:space="preserve">+ <value>移除 ({0})</value>+ </data>+ <data name="Bloatware.Menu.Refresh" xml:space="preserve">+ <value>刷新</value>+ </data>+ <data name="Bloatware.Empty.Title" xml:space="preserve">+ <value>未发现不必要的应用</value>+ </data>+ <data name="Bloatware.Empty.Description" xml:space="preserve">+ <value>optimizerDuck 未找到可移除的 AppX 包。一切看起来都很好。</value>+ </data>+ <data name="Bloatware.Loading" xml:space="preserve">+ <value>正在搜索可移除的应用…</value>+ </data></root>diff --git a/optimizerDuck/Services/BloatwareService.cs b/optimizerDuck/Services/BloatwareService.csindex 38b0334..e5942db 100644--- a/optimizerDuck/Services/BloatwareService.cs+++ b/optimizerDuck/Services/BloatwareService.cs@@ -85,6 +85,7 @@ public class BloatwareService(ILogger<BloatwareService> logger)public async Task RemoveAppXPackage(AppXPackage appXPackage){+ using var tracker = ServiceTracker.Begin(logger);try{if (string.IsNullOrWhiteSpace(appXPackage.PackageFullName))diff --git a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.csindex 3615fe5..753ca4f 100644--- a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs+++ b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs@@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input;using System.Collections.ObjectModel;using System.ComponentModel;using System.Linq;+using Microsoft.Extensions.Logging;using optimizerDuck.Core.Models.Bloatware;using optimizerDuck.Core.Models.UI;using optimizerDuck.Resources.Languages;@@ -23,19 +24,22 @@ public partial class BloatwareViewModel : ViewModelprivate readonly BloatwareService _bloatwareService;private readonly IContentDialogService _contentDialogService;private readonly ISnackbarService _snackbarService;+ private readonly ILogger<BloatwareViewModel> _logger;- public ObservableCollection<AppXPackage> AppxPackages { get; private set; } = [];+ public ObservableCollection<AppXPackage> AppxPackages { get; } = [];+ [ObservableProperty] private bool isLoading;public bool HasSelectedItems => AppxPackages.Any(x => x.IsSelected);public int SelectedCount => AppxPackages.Count(x => x.IsSelected);public BloatwareViewModel(BloatwareService bloatwareService, IContentDialogService contentDialogService,- ISnackbarService snackbarService)+ ISnackbarService snackbarService, ILogger<BloatwareViewModel> logger){_bloatwareService = bloatwareService;_contentDialogService = contentDialogService;_snackbarService = snackbarService;+ _logger = logger;AppxPackages.CollectionChanged += (_, e) =>{@@ -57,11 +61,13 @@ public partial class BloatwareViewModel : ViewModelif (_isInitialized)return;+ _isInitialized = true;++ IsLoading = true;var appxPackages = await _bloatwareService.GetAppXPackagesAsync();foreach (var package in appxPackages)AppxPackages.Add(package);-- _isInitialized = true;+ IsLoading = false;}#region Commands@@ -81,6 +87,7 @@ public partial class BloatwareViewModel : ViewModeltry{+ _logger.LogInformation("===== START removing {Count} AppX Packages =====", toRemove.Count);_ = _contentDialogService.ShowAsync(dialog, CancellationToken.None);@@ -95,14 +102,14 @@ public partial class BloatwareViewModel : ViewModelTotal = toRemove.Count,Value = i});- //await _bloatwareService.RemoveAppXPackage(item);- await Task.Delay(1000);+ await _bloatwareService.RemoveAppXPackage(item);}}finally{dialog.Hide();await Refresh();+ _logger.LogInformation("===== END removing {Count} AppX Packages =====", toRemove.Count);}}@@ -111,12 +118,14 @@ public partial class BloatwareViewModel : ViewModel[RelayCommand]private async Task Refresh(){+ IsLoading = true;AppxPackages.Clear();UpdateProperties();var appxPackages = await _bloatwareService.GetAppXPackagesAsync();foreach (var package in appxPackages)AppxPackages.Add(package);+ IsLoading = false;}#endregiondiff --git a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml b/optimizerDuck/UI/Views/Pages/BloatwarePage.xamlindex 800bdf6..20a4c95 100644--- a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml+++ b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml@@ -20,8 +20,9 @@xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><Page.Resources>- <converters:ZeroToVisibilityConverter x:Key="ZeroToVisibilityConverter" /><converters:GreaterThanZeroToVisibilityConverter x:Key="GreaterThanZeroToVisibilityConverter" />+ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />+ <converters:EmptyWhileNotLoadingConverter x:Key="EmptyWhileNotLoadingConverter" /></Page.Resources><Grid RowDefinitions="Auto *">@@ -31,15 +32,54 @@Text="{ext:Loc Bloatware.Header.Title}"TextWrapping="Wrap" />- <Border Grid.Row="1" Visibility="{Binding ViewModel.AppxPackages.Count, Converter={StaticResource ZeroToVisibilityConverter}}">+ <!-- Empty -->+ <Border Grid.Row="1">+ <Border.Visibility>+ <MultiBinding Converter="{StaticResource EmptyWhileNotLoadingConverter}">+ <Binding Path="ViewModel.AppxPackages.Count" />+ <Binding Path="ViewModel.IsLoading" />+ </MultiBinding>+ </Border.Visibility>++ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">+ <ui:SymbolIcon+ FontSize="46"+ Foreground="{DynamicResource SystemFillColorCriticalBrush}"+ HorizontalAlignment="Center"+ Margin="0,0,0,15"+ Symbol="DeleteOff24" />+ <ui:TextBlock+ FontTypography="Subtitle"+ HorizontalAlignment="Center"+ Text="{ext:Loc Bloatware.Empty.Title}" />+ <ui:TextBlock+ Appearance="Secondary"+ FontTypography="Body"+ HorizontalAlignment="Center"+ Margin="0,0,0,10"+ Text="{ext:Loc Bloatware.Empty.Description}" />+ <ui:Button+ Appearance="Primary"+ Command="{Binding ViewModel.RefreshCommand}"+ Content="{ext:Loc Bloatware.Menu.Refresh}"+ HorizontalAlignment="Center"+ Icon="{ui:SymbolIcon ArrowClockwise24,+ FontSize=18}" />+ </StackPanel>+ </Border>++ <!-- Loading -->+ <Border Grid.Row="1" Visibility="{Binding ViewModel.IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}"><StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"><ui:ProgressRingHorizontalAlignment="Center"IsIndeterminate="True"+ Margin="0,0,0,5"VerticalAlignment="Center" /><ui:TextBlock+ FontTypography="BodyStrong"HorizontalAlignment="Center"- Text="Getting AppX packages..."+ Text="{ext:Loc Bloatware.Loading}"VerticalAlignment="Center" /></StackPanel></Border>@@ -51,18 +91,24 @@Padding="8"Visibility="{Binding ViewModel.AppxPackages.Count, Converter={StaticResource GreaterThanZeroToVisibilityConverter}}"><Grid RowDefinitions="Auto *">- <Menu>- <ui:MenuItem+ <StackPanel Margin="0,0,0,5" Orientation="Horizontal">+ <ui:Button+ Appearance="Danger"Command="{Binding ViewModel.RemoveSelectedCommand}"- Header="{Binding ViewModel.SelectedCount, StringFormat='Remove ({0})'}"+ Content="{ext:Loc Bloatware.Menu.Remove,+ {Binding ViewModel.SelectedCount}}"Icon="{ui:SymbolIcon Delete24,FontSize=18}" />- <ui:MenuItem++ <Separator Margin="3,0,3,0" />++ <ui:Button+ Appearance="Primary"Command="{Binding ViewModel.RefreshCommand}"- Header="Refresh"+ Content="{ext:Loc Bloatware.Menu.Refresh}"Icon="{ui:SymbolIcon ArrowClockwise24,FontSize=18}" />- </Menu>+ </StackPanel><ui:VirtualizingItemsControl Grid.Row="1" ItemsSource="{Binding ViewModel.AppxPackages}"><ui:VirtualizingItemsControl.Template><ControlTemplate TargetType="ItemsControl">@@ -160,7 +206,7 @@<!-- Publisher --><ui:TextBlock- Appearance="Secondary"+ Appearance="Disabled"FontTypography="Body"Margin="0,2,0,0"Text="{Binding Publisher}"@@ -174,9 +220,9 @@Text="{Binding InstallLocation}"TextTrimming="CharacterEllipsis" />- <!-- Package full name (technical, nhỏ hơn) -->+ <!-- Package full name --><ui:TextBlock- Appearance="Disabled"+ Appearance="Secondary"FontTypography="Caption"Margin="0,4,0,0"Text="{Binding PackageFullName}"diff --git a/optimizerDuck/optimizerDuck.csproj b/optimizerDuck/optimizerDuck.csprojindex 7a06f88..955895f 100644--- a/optimizerDuck/optimizerDuck.csproj+++ b/optimizerDuck/optimizerDuck.csproj@@ -10,7 +10,7 @@<Authors>fatDuck</Authors><ApplicationIcon>Logo.ico</ApplicationIcon><Company>fatDuck</Company>- <FileVersion>2.0.1</FileVersion>+ <FileVersion>2.1.0</FileVersion><Version>1.0.0</Version><Product>optimizerDuck</Product><Copyright>Copyright fatDuck 2026</Copyright>