1111
1212namespace Files . App . ViewModels . Settings
1313{
14+ /// <summary>
15+ /// Represents view model of <see cref="Views.Settings.AboutPage"/>.
16+ /// </summary>
1417 public sealed class AboutViewModel : ObservableObject
1518 {
16- protected readonly IFileTagsSettingsService FileTagsSettingsService = Ioc . Default . GetRequiredService < IFileTagsSettingsService > ( ) ;
19+ // Properties
20+
21+ public string Version
22+ => string . Format ( $ "{ "SettingsAboutVersionTitle" . GetLocalizedResource ( ) } { AppVersion . Major } .{ AppVersion . Minor } .{ AppVersion . Build } .{ AppVersion . Revision } ") ;
23+
24+ public string AppName
25+ => Package . Current . DisplayName ;
26+
27+ public PackageVersion AppVersion
28+ => Package . Current . Id . Version ;
29+
30+ public ObservableCollection < OpenSourceLibraryItem > OpenSourceLibraries { get ; }
31+
32+ // Commands
1733
1834 public ICommand CopyAppVersionCommand { get ; }
1935 public ICommand CopyWindowsVersionCommand { get ; }
@@ -27,15 +43,42 @@ public sealed class AboutViewModel : ObservableObject
2743 public ICommand OpenPrivacyPolicyCommand { get ; }
2844 public ICommand OpenCrowdinCommand { get ; }
2945
30- private string _ThirdPartyNotices = string . Empty ;
31- public string ThirdPartyNotices
32- {
33- get => _ThirdPartyNotices ;
34- set => SetProperty ( ref _ThirdPartyNotices , value ) ;
35- }
46+ // Constructor
3647
48+ /// <summary>
49+ /// Initializes an instance of <see cref="AboutViewModel"/> class.
50+ /// </summary>
3751 public AboutViewModel ( )
3852 {
53+ OpenSourceLibraries =
54+ [
55+ new ( "https://github.com/omar/ByteSize" , "ByteSize" ) ,
56+ new ( "https://github.com/CommunityToolkit/dotnet" , "CommunityToolkit.Mvvm" ) ,
57+ new ( "https://github.com/DiscUtils/DiscUtils" , "DiscUtils.Udf" ) ,
58+ new ( "https://github.com/robinrodricks/FluentFTP" , "FluentFTP" ) ,
59+ new ( "https://github.com/rickyah/ini-parser" , "INI File Parser" ) ,
60+ new ( "https://github.com/libgit2/libgit2sharp" , "libgit2sharp" ) ,
61+ new ( "https://github.com/mbdavid/LiteDB" , "LiteDB" ) ,
62+ new ( "https://github.com/beto-rodriguez/LiveCharts2" , "LiveCharts2" ) ,
63+ new ( "https://github.com/jeffijoe/messageformat.net" , "MessageFormat" ) ,
64+ new ( "https://github.com/dotnet/efcore" , "EF Core for SQLite" ) ,
65+ new ( "https://github.com/dotnet/runtime" , "Microsoft.Extensions" ) ,
66+ new ( "https://github.com/files-community/SevenZipSharp" , "SevenZipSharp" ) ,
67+ new ( "https://sourceforge.net/projects/sevenzip" , "7zip" ) ,
68+ new ( "https://github.com/ericsink/SQLitePCL.raw" , "PCL for SQLite" ) ,
69+ new ( "https://github.com/microsoft/WindowsAppSDK" , "WindowsAppSDK" ) ,
70+ new ( "https://github.com/microsoft/microsoft-ui-xaml" , "WinUI 3" ) ,
71+ new ( "https://github.com/microsoft/Win2D" , "Win2D" ) ,
72+ new ( "https://github.com/CommunityToolkit/WindowsCommunityToolkit" , "Windows Community Toolkit 7.x" ) ,
73+ new ( "https://github.com/mono/taglib-sharp" , "TagLibSharp" ) ,
74+ new ( "https://github.com/Tulpep/Active-Directory-Object-Picker" , "ActiveDirectoryObjectPicker" ) ,
75+ new ( "https://github.com/dotMorten/WinUIEx" , "WinUIEx" ) ,
76+ new ( "https://github.com/dahall/Vanara" , "Vanara" ) ,
77+ new ( "https://github.com/PowerShell/MMI" , "MMI" ) ,
78+ new ( "https://github.com/microsoft/CsWin32" , "CsWin32" ) ,
79+ new ( "https://github.com/microsoft/CsWinRT" , "CsWinRT" ) ,
80+ ] ;
81+
3982 CopyAppVersionCommand = new RelayCommand ( CopyAppVersion ) ;
4083 CopyWindowsVersionCommand = new RelayCommand ( CopyWindowsVersion ) ;
4184 SupportUsCommand = new AsyncRelayCommand ( SupportUs ) ;
@@ -49,6 +92,8 @@ public AboutViewModel()
4992 OpenCrowdinCommand = new AsyncRelayCommand ( DoOpenCrowdin ) ;
5093 }
5194
95+ // Methods
96+
5297 private async Task < bool > OpenLogLocation ( )
5398 {
5499 await Launcher . LaunchFolderAsync ( ApplicationData . Current . LocalFolder ) . AsTask ( ) ;
@@ -95,7 +140,6 @@ public Task DoOpenPrivacyPolicy()
95140 return Launcher . LaunchUriAsync ( new Uri ( Constants . ExternalUrl . PrivacyPolicyUrl ) ) . AsTask ( ) ;
96141 }
97142
98-
99143 public Task DoOpenCrowdin ( )
100144 {
101145 return Launcher . LaunchUriAsync ( new Uri ( Constants . ExternalUrl . CrowdinUrl ) ) . AsTask ( ) ;
@@ -128,12 +172,6 @@ public Task SupportUs()
128172 return Launcher . LaunchUriAsync ( new Uri ( Constants . ExternalUrl . SupportUsUrl ) ) . AsTask ( ) ;
129173 }
130174
131- public async Task LoadThirdPartyNoticesAsync ( )
132- {
133- StorageFile file = await StorageFile . GetFileFromApplicationUriAsync ( new Uri ( Constants . DocsPath . ThirdPartyNoticePath ) ) ;
134- ThirdPartyNotices = await FileIO . ReadTextAsync ( file ) ;
135- }
136-
137175 public string GetAppVersion ( )
138176 {
139177 return string . Format ( $ "{ AppVersion . Major } .{ AppVersion . Minor } .{ AppVersion . Build } .{ AppVersion . Revision } ") ;
@@ -151,16 +189,5 @@ public string GetVersionsQueryString()
151189 query [ "windows_version" ] = GetWindowsVersion ( ) ;
152190 return query . ToString ( ) ?? string . Empty ;
153191 }
154-
155- public string Version
156- {
157- get
158- {
159- return string . Format ( $ "{ "SettingsAboutVersionTitle" . GetLocalizedResource ( ) } { AppVersion . Major } .{ AppVersion . Minor } .{ AppVersion . Build } .{ AppVersion . Revision } ") ;
160- }
161- }
162-
163- public string AppName => Package . Current . DisplayName ;
164- public PackageVersion AppVersion => Package . Current . Id . Version ;
165192 }
166193}
0 commit comments