Skip to content

Commit

Permalink
perf: better AboutPage ui
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed Feb 5, 2024
1 parent 67afb33 commit 37ca094
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/PipManager/Models/Pages/AboutNugetLibraryListItem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace PipManager.Models.Pages;

public class AboutNugetLibraryListItem(string libraryName, string libraryVersion, string libraryLicenseType, string libraryCopyright, string libraryUrl)
public class AboutNugetLibraryListItem(string libraryName, string libraryLicenseType, string libraryCopyright, string libraryUrl)
{
public string LibraryName { get; set; } = libraryName;
public string LibraryVersion { get; set; } = libraryVersion;
public string LibraryLicenseType { get; set; } = libraryLicenseType;
public string LibraryCopyright { get; set; } = libraryCopyright;
public string LibraryUrl { get; set; } = libraryUrl;
Expand Down
23 changes: 12 additions & 11 deletions src/PipManager/ViewModels/Pages/About/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ private void InitializeViewModel()
[ObservableProperty]
private ObservableCollection<AboutNugetLibraryListItem> _nugetLibraryList =
[
new AboutNugetLibraryListItem("Antelcat.I18N.WPF", "1.0.1", "MIT", "Copyright (c) 2023 Feast", "https://github.com/Antelcat/Antelcat.I18N"),
new AboutNugetLibraryListItem("CommunityToolkit.Mvvm", "8.2.2", "MIT", "Copyright © .NET Foundation and Contributors", "https://github.com/CommunityToolkit/dotnet"),
new AboutNugetLibraryListItem("Microsoft.Extensions.Hosting", "8.0.0", "MIT", "Copyright © .NET Foundation and Contributors", "https://github.com/dotnet/runtime"),
new AboutNugetLibraryListItem("Microsoft.Xaml.Behaviors.Wpf", "1.1.75", "MIT", "Copyright (c) 2015 Microsoft", "https://github.com/microsoft/XamlBehaviorsWpf"),
new AboutNugetLibraryListItem("Newtonsoft.Json", "13.0.3", "MIT", "Copyright (c) 2007 James Newton-King", "https://github.com/JamesNK/Newtonsoft.Json"),
new AboutNugetLibraryListItem("Serilog", "3.1.1", "Apache-2.0", "Copyright © 2013-2020 Serilog Contributors", "https://github.com/serilog/serilog"),
new AboutNugetLibraryListItem("Serilog.Sinks.Console", "5.0.1", "Apache-2.0", "Copyright © 2016 Serilog Contributors", "https://github.com/serilog/serilog-sinks-console"),
new AboutNugetLibraryListItem("Serilog.Sinks.File", "5.0.0", "Apache-2.0", "Copyright © 2016 Serilog Contributors", "https://github.com/serilog/serilog-sinks-file"),
new AboutNugetLibraryListItem("ValueConverters", "3.0.26", "MIT", "Copyright (c) 2019 Thomas Galliker", "https://github.com/thomasgalliker/ValueConverters.NET"),
new AboutNugetLibraryListItem("WPF-UI", "3.0.0-preview.13", "MIT", "Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors.", "https://github.com/lepoco/wpfui"),
new AboutNugetLibraryListItem("WPF-UI.Tray", "3.0.0-preview.11", "MIT", "Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors.", "https://github.com/lepoco/wpfui"),
new AboutNugetLibraryListItem("Antelcat.I18N.WPF", "MIT", "Copyright (c) 2023 Feast", "https://github.com/Antelcat/Antelcat.I18N"),
new AboutNugetLibraryListItem("CommunityToolkit.Mvvm", "MIT", "Copyright © .NET Foundation and Contributors", "https://github.com/CommunityToolkit/dotnet"),
new AboutNugetLibraryListItem("Microsoft.Extensions.Hosting", "MIT", "Copyright © .NET Foundation and Contributors", "https://github.com/dotnet/runtime"),
new AboutNugetLibraryListItem("Microsoft.Xaml.Behaviors.Wpf", "MIT", "Copyright (c) 2015 Microsoft", "https://github.com/microsoft/XamlBehaviorsWpf"),
new AboutNugetLibraryListItem("Newtonsoft.Json", "MIT", "Copyright (c) 2007 James Newton-King", "https://github.com/JamesNK/Newtonsoft.Json"),
new AboutNugetLibraryListItem("Serilog", "3.1.1", "Copyright © 2013-2020 Serilog Contributors", "https://github.com/serilog/serilog"),
new AboutNugetLibraryListItem("Serilog.Sinks.Console", "Apache-2.0", "Copyright © 2016 Serilog Contributors", "https://github.com/serilog/serilog-sinks-console"),
new AboutNugetLibraryListItem("Serilog.Sinks.File", "Apache-2.0", "Copyright © 2016 Serilog Contributors", "https://github.com/serilog/serilog-sinks-file"),
new AboutNugetLibraryListItem("ValueConverters", "MIT", "Copyright (c) 2019 Thomas Galliker", "https://github.com/thomasgalliker/ValueConverters.NET"),
new AboutNugetLibraryListItem("WPF-UI", "MIT", "Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors", "https://github.com/lepoco/wpfui"),
new AboutNugetLibraryListItem("WPF-UI.Tray", "MIT", "Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors", "https://github.com/lepoco/wpfui"),
new AboutNugetLibraryListItem("HtmlAgilityPack", "MIT", "Copyright © ZZZ Projects Inc.", "https://github.com/zzzprojects/html-agility-pack"),
];
}
15 changes: 4 additions & 11 deletions src/PipManager/Views/Pages/About/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,10 @@
Icon="{ui:SymbolIcon Link24}"
NavigateUri="{Binding LibraryUrl}" />
<StackPanel Margin="5,0,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="14"
Text="{Binding LibraryName}" />
<TextBlock FontSize="14" Text=" " />
<ui:Badge
Appearance="Primary"
Content="{Binding LibraryVersion}"
FontSize="12" />
</StackPanel>
<TextBlock
VerticalAlignment="Center"
FontSize="14"
Text="{Binding LibraryName}" />

<StackPanel Orientation="Horizontal">
<TextBlock
Expand Down

0 comments on commit 37ca094

Please sign in to comment.