Skip to content

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

feat: add BloatwarePage.xaml

itsfatduck500123a02bb5
diff --git a/optimizerDuck/App.xaml.cs b/optimizerDuck/App.xaml.cs
index c2df69c..8b0f2dc 100644
--- a/optimizerDuck/App.xaml.cs
+++ b/optimizerDuck/App.xaml.cs
@@ -13,6 +13,8 @@ using optimizerDuck.Services;
using optimizerDuck.Services.Managers;
using optimizerDuck.Services.OptimizationServices;
using optimizerDuck.UI.ViewModels.Pages;
+using optimizerDuck.UI.Views.Pages;
+using optimizerDuck.UI.Views.Windows;
using Serilog;
using Serilog.Events;
using Serilog.Formatting;
@@ -20,12 +22,6 @@ using Serilog.Parsing;
using Wpf.Ui;
using Wpf.Ui.Appearance;
using Wpf.Ui.DependencyInjection;
-using DashboardPage = optimizerDuck.UI.Views.Pages.DashboardPage;
-using DashboardViewModel = optimizerDuck.UI.ViewModels.Pages.DashboardViewModel;
-using MainWindow = optimizerDuck.UI.Views.Windows.MainWindow;
-using OptimizePage = optimizerDuck.UI.Views.Pages.OptimizePage;
-using SettingsPage = optimizerDuck.UI.Views.Pages.SettingsPage;
-using SettingsViewModel = optimizerDuck.UI.ViewModels.Pages.SettingsViewModel;
namespace optimizerDuck;
@@ -158,6 +154,9 @@ public partial class App : Application
services.AddSingleton<SettingsViewModel>();
services.AddSingleton<SettingsPage>();
+
+ services.AddSingleton<BloatwareViewModel>();
+ services.AddSingleton<BloatwarePage>();
// Optimizations
services.AddAllOptimizationPages();
diff --git a/optimizerDuck/Core/Models/Bloatware/AppxPackage.cs b/optimizerDuck/Core/Models/Bloatware/AppxPackage.cs
new file mode 100644
index 0000000..4531962
--- /dev/null
+++ b/optimizerDuck/Core/Models/Bloatware/AppxPackage.cs
@@ -0,0 +1,14 @@
+namespace optimizerDuck.Core.Models.Bloatware;
+
+public record AppxPackage
+{
+ public bool IsSelected { get; set; } = false;
+
+ public string Name { get; init; }
+ public string PackageFullName { get; init; }
+ public string Publisher { get; init; }
+ public string Version { get; init; }
+ public string InstallLocation { get; init; }
+ public DateTime InstallDate { get; init; }
+ public bool NonRemovable { get; init; }
+};
\ No newline at end of file
diff --git a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
new file mode 100644
index 0000000..41eec23
--- /dev/null
+++ b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
@@ -0,0 +1,69 @@
+using System.Collections.ObjectModel;
+using optimizerDuck.Core.Models.Bloatware;
+
+namespace optimizerDuck.UI.ViewModels.Pages;
+
+public class BloatwareViewModel
+{
+ public ObservableCollection<AppxPackage> AppxPackages { get; private set; } = new();
+
+ public BloatwareViewModel()
+ {
+ // generate sample AppxPackages
+ AppxPackages.Add(new AppxPackage
+ {
+ Name = "Microsoft.WindowsCalculator",
+ PackageFullName = "Microsoft.WindowsCalculator_11.2401.0.0_x64__8wekyb3d8bbwe",
+ Publisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
+ Version = "11.2401.0.0",
+ InstallLocation =
+ @"C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_11.2401.0.0_x64__8wekyb3d8bbwe",
+ InstallDate = DateTime.Now.AddDays(-30),
+ NonRemovable = false,
+ });
+
+ AppxPackages.Add(new AppxPackage
+ {
+ Name = "Microsoft.WindowsStore",
+ PackageFullName = "Microsoft.WindowsStore_22401.1401.3.0_x64__8wekyb3d8bbwe",
+ Publisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
+ Version = "22401.1401.3.0",
+ InstallLocation = @"C:\Program Files\WindowsApps\Microsoft.WindowsStore_22401.1401.3.0_x64__8wekyb3d8bbwe",
+ InstallDate = DateTime.Now.AddMonths(-2),
+ NonRemovable = true, // system protected
+ });
+
+ AppxPackages.Add(new AppxPackage
+ {
+ Name = "Contoso.MediaPlayer",
+ PackageFullName = "Contoso.MediaPlayer_2.5.3.0_x64__abcd1234efgh",
+ Publisher = "CN=Contoso Software Ltd, O=Contoso Ltd, C=US",
+ Version = "2.5.3.0",
+ InstallLocation = @"C:\Program Files\WindowsApps\Contoso.MediaPlayer_2.5.3.0_x64__abcd1234efgh",
+ InstallDate = DateTime.Now.AddDays(-7),
+ NonRemovable = false,
+ });
+
+ AppxPackages.Add(new AppxPackage
+ {
+ Name = "Fabrikam.PhotoEditor",
+ PackageFullName = "Fabrikam.PhotoEditor_5.0.1.0_x86__xyz987654321",
+ Publisher = "CN=Fabrikam Inc, O=Fabrikam Inc, C=US",
+ Version = "5.0.1.0",
+ InstallLocation = @"C:\Program Files\WindowsApps\Fabrikam.PhotoEditor_5.0.1.0_x86__xyz987654321",
+ InstallDate = DateTime.Now.AddDays(-120),
+ NonRemovable = false,
+ });
+
+ AppxPackages.Add(new AppxPackage
+ {
+ Name = "Microsoft.VCLibs.140.00",
+ PackageFullName = "Microsoft.VCLibs.140.00_14.0.32530.0_x64__8wekyb3d8bbwe",
+ Publisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
+ Version = "14.0.32530.0",
+ InstallLocation = @"C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00_14.0.32530.0_x64__8wekyb3d8bbwe",
+ InstallDate = DateTime.Now.AddYears(-1),
+ NonRemovable = true, // framework
+ });
+ }
+}
\ No newline at end of file
diff --git a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml
new file mode 100644
index 0000000..81f41d8
--- /dev/null
+++ b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml
@@ -0,0 +1,60 @@
+<Page
+ Foreground="{DynamicResource TextFillColorPrimaryBrush}"
+ Margin="0,32,0,0"
+ ScrollViewer.CanContentScroll="False"
+ Title="BloatwarePage"
+ d:DesignHeight="1200"
+ d:DesignWidth="800"
+ mc:Ignorable="d"
+ ui:Design.Background="Black"
+ ui:Design.Foreground="White"
+ x:Class="optimizerDuck.UI.Views.Pages.BloatwarePage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:bloatware="clr-namespace:optimizerDuck.Core.Models.Bloatware"
+ 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:ui="http://schemas.lepo.co/wpfui/2022/xaml"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ <StackPanel>
+ <ui:TextBlock
+ FontTypography="Title"
+ Text="{ext:Loc Bloatware.Header.Title}"
+ TextWrapping="Wrap" />
+
+ <ui:ListView ItemsSource="{Binding ViewModel.AppxPackages}">
+ <ui:ListView.View>
+ <ui:GridView>
+
+
+ <!-- Checkbox -->
+ <ui:GridViewColumn Width="40">
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsSelected, Mode=TwoWay}" />
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </ui:GridViewColumn>
+
+ <!-- App Name -->
+ <ui:GridViewColumn
+ DisplayMemberBinding="{Binding Name}"
+ Header="App Name"
+ Width="200" />
+
+ <!-- Category -->
+ <ui:GridViewColumn
+ DisplayMemberBinding="{Binding Category}"
+ Header="Category"
+ Width="120" />
+
+
+
+
+ </ui:GridView>
+ </ui:ListView.View>
+ </ui:ListView>
+
+ </StackPanel>
+</Page>
diff --git a/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml.cs b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml.cs
new file mode 100644
index 0000000..dc2f6e5
--- /dev/null
+++ b/optimizerDuck/UI/Views/Pages/BloatwarePage.xaml.cs
@@ -0,0 +1,18 @@
+using System.Windows.Controls;
+using optimizerDuck.UI.ViewModels.Pages;
+using Wpf.Ui.Abstractions.Controls;
+
+namespace optimizerDuck.UI.Views.Pages;
+
+public partial class BloatwarePage : INavigableView<BloatwareViewModel>
+{
+ public BloatwarePage(BloatwareViewModel viewModel)
+ {
+ ViewModel = viewModel;
+ DataContext = this;
+
+ InitializeComponent();
+ }
+
+ public BloatwareViewModel ViewModel { get; }
+}
\ No newline at end of file
diff --git a/optimizerDuck/UI/Views/Windows/MainWindow.xaml b/optimizerDuck/UI/Views/Windows/MainWindow.xaml
index f1f4544..8331013 100644
--- a/optimizerDuck/UI/Views/Windows/MainWindow.xaml
+++ b/optimizerDuck/UI/Views/Windows/MainWindow.xaml
@@ -37,12 +37,18 @@
Content="{extensions:Loc Sidebar.Dashboard}"
Icon="{ui:SymbolIcon Home24}"
TargetPageType="{x:Type pages:DashboardPage}" />
+
<ui:NavigationViewItemSeparator Margin="0,2,0,2" />
<ui:NavigationViewItem
Content="{extensions:Loc Sidebar.Optimize}"
Icon="{ui:SymbolIcon Rocket24}"
TargetPageType="{x:Type pages:OptimizePage}" />
+
+ <ui:NavigationViewItem
+ Content="{extensions:Loc Sidebar.Bloatware}"
+ Icon="{ui:SymbolIcon Delete24}"
+ TargetPageType="{x:Type pages:BloatwarePage}" />
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>