diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw new file mode 100644 index 0000000..f4bd306 --- /dev/null +++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/AboutViewResources.resw @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Developers + + + Donation + + + More + + + Repository + + + Self-built version + + + Translation (English (US)) + + \ No newline at end of file diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/BaseViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/BaseViewResources.resw index df0e3fa..3df704d 100644 --- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/BaseViewResources.resw +++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/BaseViewResources.resw @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + About + Authentication diff --git a/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs b/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs new file mode 100644 index 0000000..938ad57 --- /dev/null +++ b/VDownload.Core/VDownload.Core.ViewModels/About/AboutViewModel.cs @@ -0,0 +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 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.ViewModels/BaseViewModel.cs b/VDownload.Core/VDownload.Core.ViewModels/BaseViewModel.cs index 0e1986b..8ec282b 100644 --- a/VDownload.Core/VDownload.Core.ViewModels/BaseViewModel.cs +++ b/VDownload.Core/VDownload.Core.ViewModels/BaseViewModel.cs @@ -12,6 +12,7 @@ using VDownload.Core.ViewModels.Settings; using VDownload.Services.UI.DictionaryResources; using VDownload.Services.UI.StringResources; using SimpleToolkit.UI.Models; +using VDownload.Core.ViewModels.About; namespace VDownload.Core.ViewModels { @@ -72,6 +73,12 @@ namespace VDownload.Core.ViewModels ( new ObservableCollection { + new NavigationViewItem() + { + Name = _stringResourcesService.BaseViewResources.Get("AboutNavigationViewItem"), + IconSource = _dictionaryResourcesService.Get("ImageBaseViewAbout"), + ViewModel = typeof(AboutViewModel), + }, new NavigationViewItem() { Name = _stringResourcesService.BaseViewResources.Get("AuthenticationNavigationViewItem"), diff --git a/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml b/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml new file mode 100644 index 0000000..67ed693 --- /dev/null +++ b/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml.cs b/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml.cs new file mode 100644 index 0000000..1fbcd3e --- /dev/null +++ b/VDownload.Core/VDownload.Core.Views/About/AboutView.xaml.cs @@ -0,0 +1,32 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using VDownload.Core.ViewModels.About; +using VDownload.Core.ViewModels.Home; +using Windows.Foundation; +using Windows.Foundation.Collections; + +namespace VDownload.Core.Views.About +{ + public sealed partial class AboutView : Page + { + #region CONSTRUCTORS + + public AboutView(AboutViewModel viewModel) + { + this.InitializeComponent(); + this.DataContext = viewModel; + } + + #endregion + } +} diff --git a/VDownload.Core/VDownload.Core.Views/VDownload.Core.Views.csproj b/VDownload.Core/VDownload.Core.Views/VDownload.Core.Views.csproj index c840d2b..376e829 100644 --- a/VDownload.Core/VDownload.Core.Views/VDownload.Core.Views.csproj +++ b/VDownload.Core/VDownload.Core.Views/VDownload.Core.Views.csproj @@ -9,6 +9,7 @@ false + @@ -31,6 +32,9 @@ + + MSBuild:Compile + MSBuild:Compile diff --git a/VDownload.Core/VDownload.Core.Views/ViewModelToViewConverter.cs b/VDownload.Core/VDownload.Core.Views/ViewModelToViewConverter.cs index 7ce906b..c001505 100644 --- a/VDownload.Core/VDownload.Core.Views/ViewModelToViewConverter.cs +++ b/VDownload.Core/VDownload.Core.Views/ViewModelToViewConverter.cs @@ -2,9 +2,11 @@ using System; using System.Collections.Generic; using System.Linq; +using VDownload.Core.ViewModels.About; using VDownload.Core.ViewModels.Authentication; using VDownload.Core.ViewModels.Home; using VDownload.Core.ViewModels.Settings; +using VDownload.Core.Views.About; using VDownload.Core.Views.Authentication; using VDownload.Core.Views.Home; using VDownload.Core.Views.Settings; @@ -22,6 +24,7 @@ namespace VDownload.Core.Views { typeof(HomeVideoViewModel), typeof(HomeVideoView) }, { typeof(HomePlaylistViewModel), typeof(HomePlaylistView) }, { typeof(SettingsViewModel), typeof(SettingsView) }, + { typeof(AboutViewModel), typeof(AboutView) }, { typeof(AuthenticationViewModel), typeof(AuthenticationView) } }; 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.Services/VDownload.Services.UI/VDownload.Services.UI.StringResources/StringResourcesService.cs b/VDownload.Services/VDownload.Services.UI/VDownload.Services.UI.StringResources/StringResourcesService.cs index 0748449..d131d62 100644 --- a/VDownload.Services/VDownload.Services.UI/VDownload.Services.UI.StringResources/StringResourcesService.cs +++ b/VDownload.Services/VDownload.Services.UI/VDownload.Services.UI.StringResources/StringResourcesService.cs @@ -17,6 +17,7 @@ namespace VDownload.Services.UI.StringResources StringResources DialogButtonsResources { get; } StringResources SettingsViewResources { get; } StringResources FilenameTemplateResources { get; } + StringResources AboutViewResources { get; } } @@ -45,6 +46,7 @@ namespace VDownload.Services.UI.StringResources public StringResources DialogButtonsResources { get; protected set; } public StringResources SettingsViewResources { get; protected set; } public StringResources FilenameTemplateResources { get; protected set; } + public StringResources AboutViewResources { get; protected set; } #endregion @@ -68,6 +70,7 @@ namespace VDownload.Services.UI.StringResources DialogButtonsResources = BuildResource("DialogButtonsResources"); SettingsViewResources = BuildResource("SettingsViewResources"); FilenameTemplateResources = BuildResource("FilenameTemplateResources"); + AboutViewResources = BuildResource("AboutViewResources"); } #endregion 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/Assets/BaseView/AboutDark.png b/VDownload/Assets/BaseView/AboutDark.png new file mode 100644 index 0000000..a3e8957 Binary files /dev/null and b/VDownload/Assets/BaseView/AboutDark.png differ diff --git a/VDownload/Assets/BaseView/AboutLight.png b/VDownload/Assets/BaseView/AboutLight.png new file mode 100644 index 0000000..5f5802e Binary files /dev/null and b/VDownload/Assets/BaseView/AboutLight.png differ diff --git a/VDownload/Dictionaries/Images/ImagesBaseView.xaml b/VDownload/Dictionaries/Images/ImagesBaseView.xaml index 1555d1c..1509708 100644 --- a/VDownload/Dictionaries/Images/ImagesBaseView.xaml +++ b/VDownload/Dictionaries/Images/ImagesBaseView.xaml @@ -6,10 +6,12 @@ /Assets/BaseView/AuthenticationDark.png /Assets/BaseView/HomeDark.png + /Assets/BaseView/AboutDark.png /Assets/BaseView/AuthenticationLight.png /Assets/BaseView/HomeLight.png + /Assets/BaseView/AboutLight.png 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 a171dc6..c52bd40 100644 --- a/VDownload/VDownload.csproj +++ b/VDownload/VDownload.csproj @@ -1,202 +1,218 @@ - - - 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 + + + Always + 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",