diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw index 76fc78a..f4bd306 100644 --- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw +++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw @@ -117,7 +117,22 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ss + + Developers + + + Donation + + + More + + + Repository + + + Self-built version + + + Translation (English (US)) \ No newline at end of file diff --git a/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs b/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs index bf3bcce..938ad57 100644 --- a/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs +++ b/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs @@ -1,13 +1,88 @@ using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Microsoft.UI.Xaml; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; +using VDownload.Core.ViewModels.About.Helpers; +using VDownload.Services.Data.Configuration; +using VDownload.Services.Data.Configuration.Models; +using VDownload.Services.UI.StringResources; +using Windows.System.UserProfile; namespace VDownload.Core.ViewModels.About { - public class AboutViewModel : ObservableObject + public partial class AboutViewModel : ObservableObject { + #region SERVICES + + protected readonly IStringResourcesService _stringResourcesService; + protected readonly IConfigurationService _configurationService; + + #endregion + + + + #region PROPERTIES + + [ObservableProperty] + protected string _version; + + [ObservableProperty] + protected ObservableCollection _developers; + + [ObservableProperty] + protected ObservableCollection _translators; + + [ObservableProperty] + protected Uri _repositoryUrl; + + [ObservableProperty] + protected Uri _donationUrl; + + #endregion + + + + #region CONSTRUCTORS + + public AboutViewModel(IStringResourcesService stringResourcesService, IConfigurationService configurationService) + { + _stringResourcesService = stringResourcesService; + _configurationService = configurationService; + + string version = Assembly.GetEntryAssembly().GetCustomAttribute()?.InformationalVersion; + if (version == "0.0.0") + { + version = _stringResourcesService.AboutViewResources.Get("SelfbuiltVersion"); + } + _version = version; + + _developers = new ObservableCollection(_configurationService.Common.About.Developers.Select(x => new PersonViewModel(x.Name, x.Url))); + + _repositoryUrl = new Uri(_configurationService.Common.About.RepositoryUrl); + _donationUrl = new Uri(_configurationService.Common.About.DonationUrl); + } + + #endregion + + + + #region COMMANDS + + [RelayCommand] + public void Navigation() + { + string languageCode = "en-US"; + Language language = _configurationService.Common.About.Translation.FirstOrDefault(x => x.Code == languageCode); + Translators = new ObservableCollection(language.Translators.Select(x => new PersonViewModel(x.Name, x.Url))); + } + + #endregion } } diff --git a/VDownload.Core/VDownload.Core.ViewModels/About/Helpers/PersonViewModel.cs b/VDownload.Core/VDownload.Core.ViewModels/About/Helpers/PersonViewModel.cs new file mode 100644 index 0000000..979fcc1 --- /dev/null +++ b/VDownload.Core/VDownload.Core.ViewModels/About/Helpers/PersonViewModel.cs @@ -0,0 +1,34 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VDownload.Core.ViewModels.About.Helpers +{ + public partial class PersonViewModel : ObservableObject + { + #region PROPERTIES + + [ObservableProperty] + protected string _name; + + [ObservableProperty] + protected Uri _url; + + #endregion + + + + #region CONSTRUCTORS + + public PersonViewModel(string name, string url) + { + _name = name; + _url = new Uri(url); + } + + #endregion + } +} diff --git a/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml b/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml index 5b1847d..67ed693 100644 --- a/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml +++ b/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml @@ -6,10 +6,88 @@ xmlns:local="using:VDownload.Core.Views.About" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:i="using:Microsoft.Xaml.Interactivity" + xmlns:ic="using:Microsoft.Xaml.Interactions.Core" mc:Ignorable="d" Background="Transparent"> - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/CommonConfiguration.cs b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/CommonConfiguration.cs index c3001d5..831dba5 100644 --- a/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/CommonConfiguration.cs +++ b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/CommonConfiguration.cs @@ -6,6 +6,9 @@ namespace VDownload.Services.Data.Configuration { public class CommonConfiguration { + [ConfigurationKeyName("about")] + public About About { get; set; } + [ConfigurationKeyName("filename_templates")] public IEnumerable FilenameTemplates { get; set; } diff --git a/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/About.cs b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/About.cs new file mode 100644 index 0000000..594f411 --- /dev/null +++ b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/About.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VDownload.Services.Data.Configuration.Models +{ + public class About + { + [ConfigurationKeyName("repository_url")] + public string RepositoryUrl { get; set; } + + [ConfigurationKeyName("donation_url")] + public string DonationUrl { get; set; } + + [ConfigurationKeyName("developers")] + public IEnumerable Developers { get; set; } + + [ConfigurationKeyName("translation")] + public IEnumerable Translation { get; set; } + } +} diff --git a/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/Language.cs b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/Language.cs new file mode 100644 index 0000000..bd507af --- /dev/null +++ b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/Language.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VDownload.Services.Data.Configuration.Models +{ + public class Language + { + [ConfigurationKeyName("code")] + public string Code { get; set; } + + [ConfigurationKeyName("translators")] + public IEnumerable Translators { get; set; } + } +} diff --git a/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/Person.cs b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/Person.cs new file mode 100644 index 0000000..19058db --- /dev/null +++ b/VDownload.Services/VDownload.Services.Data/VDownload.Services.Data.Configuration/Models/Person.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VDownload.Services.Data.Configuration.Models +{ + public class Person + { + [ConfigurationKeyName("name")] + public string Name { get; set; } + + [ConfigurationKeyName("url")] + public string Url { get; set; } + } +} diff --git a/VDownload/App.xaml.cs b/VDownload/App.xaml.cs index 9d90d35..1ae468d 100644 --- a/VDownload/App.xaml.cs +++ b/VDownload/App.xaml.cs @@ -7,10 +7,12 @@ using System.Net.Http; using System.Threading.Tasks; using VDownload.Core.Tasks; using VDownload.Core.ViewModels; +using VDownload.Core.ViewModels.About; using VDownload.Core.ViewModels.Authentication; using VDownload.Core.ViewModels.Home; using VDownload.Core.ViewModels.Settings; using VDownload.Core.Views; +using VDownload.Core.Views.About; using VDownload.Core.Views.Authentication; using VDownload.Core.Views.Home; using VDownload.Core.Views.Settings; @@ -145,6 +147,7 @@ namespace VDownload protected void BuildPresentation(IServiceCollection services) { // ViewModels + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); @@ -154,6 +157,7 @@ namespace VDownload services.AddSingleton(); // Views + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/VDownload/Package.appxmanifest b/VDownload/Package.appxmanifest index 9268db1..858c5db 100644 --- a/VDownload/Package.appxmanifest +++ b/VDownload/Package.appxmanifest @@ -8,15 +8,15 @@ IgnorableNamespaces="uap rescap"> + Version="0.0.0.0" /> VDownload - mateusz + Mateusz Skoczek Assets\Logo\StoreLogo.png diff --git a/VDownload/VDownload.csproj b/VDownload/VDownload.csproj index c24c481..c52bd40 100644 --- a/VDownload/VDownload.csproj +++ b/VDownload/VDownload.csproj @@ -1,202 +1,212 @@ - - - WinExe - net8.0-windows10.0.19041.0 - 10.0.17763.0 - VDownload - app.manifest - x86;x64;ARM64 - win10-x86;win10-x64;win10-arm64 - win10-$(Platform).pubxml - true - true - true - true - false - Assets\Logo\Logo.ico - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + WinExe + net8.0-windows10.0.19041.0 + 10.0.17763.0 + VDownload + app.manifest + x86;x64;ARM64 + win10-x86;win10-x64;win10-arm64 + win10-$(Platform).pubxml + true + true + true + true + false + Assets\Logo\Logo.ico + LICENSE + True + 0.0.0 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + True + \ + + + + + + + + + + + + + + + + + + + + + + + + Always diff --git a/VDownload/configuration.json b/VDownload/configuration.json index 1f953b2..3d9223b 100644 --- a/VDownload/configuration.json +++ b/VDownload/configuration.json @@ -1,5 +1,26 @@ { "common": { + "about": { + "repository_url": "https://github.com/mateuszskoczek/VDownload", + "donation_url": "https://paypal.me/mateuszskoczek", + "developers": [ + { + "name": "Mateusz Skoczek", + "url": "https://github.com/mateuszskoczek" + } + ], + "translation": [ + { + "code": "en-US", + "translators": [ + { + "name": "Mateusz Skoczek", + "url": "https://github.com/mateuszskoczek" + } + ] + } + ] + }, "filename_templates": [ { "name": "id",