From 4451109ba14d39650a5beb36aa939084317d37e8 Mon Sep 17 00:00:00 2001 From: Richasy Date: Fri, 17 Sep 2021 19:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=B3=E4=BA=8E=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E8=AF=B4=E6=98=8E=20(#57)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 添加关于应用的说明 * Update doc.md * Create LICENSE --- .github/ISSUE_TEMPLATE/doc.md | 2 ++ LICENSE | 21 +++++++++++++++++++ src/App/Pages/SettingPage.xaml | 18 ++++++++++++++++ src/App/Pages/SettingPage.xaml.cs | 8 ++++++- .../Resources/Strings/zh-CN/Resources.resw | 6 ++++++ src/Models/Models.Enums/App/LanguageNames.cs | 2 ++ .../SettingViewModel.Properties.cs | 6 ++++++ .../SettingViewModel/SettingViewModel.cs | 3 +++ 8 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/.github/ISSUE_TEMPLATE/doc.md b/.github/ISSUE_TEMPLATE/doc.md index ae9699e95..47765858c 100644 --- a/.github/ISSUE_TEMPLATE/doc.md +++ b/.github/ISSUE_TEMPLATE/doc.md @@ -7,6 +7,8 @@ assignees: Richasy --- + + ## 关联文档 diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..9af03e830 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Richasy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/App/Pages/SettingPage.xaml b/src/App/Pages/SettingPage.xaml index 505e65441..da7bac4cf 100644 --- a/src/App/Pages/SettingPage.xaml +++ b/src/App/Pages/SettingPage.xaml @@ -10,6 +10,13 @@ xmlns:muxc="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d"> + + + + @@ -55,6 +62,17 @@ + + + + + + + + diff --git a/src/App/Pages/SettingPage.xaml.cs b/src/App/Pages/SettingPage.xaml.cs index efc9a386f..bf09b3725 100644 --- a/src/App/Pages/SettingPage.xaml.cs +++ b/src/App/Pages/SettingPage.xaml.cs @@ -17,12 +17,18 @@ public sealed partial class SettingPage : Page public SettingPage() { this.InitializeComponent(); + ViewModel = SettingViewModel.Instance; } + /// + /// 视图模型. + /// + public SettingViewModel ViewModel { get; private set; } + /// protected override void OnNavigatedTo(NavigationEventArgs e) { - SettingViewModel.Instance.InitializeSettings(); + ViewModel.InitializeSettings(); } } } diff --git a/src/App/Resources/Strings/zh-CN/Resources.resw b/src/App/Resources/Strings/zh-CN/Resources.resw index b6c60c6ba..1a594d79b 100644 --- a/src/App/Resources/Strings/zh-CN/Resources.resw +++ b/src/App/Resources/Strings/zh-CN/Resources.resw @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 关于此应用 + 添加评论失败,请稍后再试 @@ -476,6 +479,9 @@ 最新评论 + + ©2021 Richasy. MIT 许可证 + 浅色 diff --git a/src/Models/Models.Enums/App/LanguageNames.cs b/src/Models/Models.Enums/App/LanguageNames.cs index b7c7b9095..de9a3c2a4 100644 --- a/src/Models/Models.Enums/App/LanguageNames.cs +++ b/src/Models/Models.Enums/App/LanguageNames.cs @@ -328,6 +328,8 @@ public enum LanguageNames NoRoomDescription, LogEmptied, FailedToClearLog, + AboutThisApp, + License, #pragma warning restore SA1602 // Enumeration items should be documented } } diff --git a/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.Properties.cs b/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.Properties.cs index ab8f77e46..9fe757e24 100644 --- a/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.Properties.cs +++ b/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.Properties.cs @@ -105,5 +105,11 @@ public partial class SettingViewModel /// [Reactive] public double SingleFastForwardAndRewindSpan { get; set; } + + /// + /// 应用版本. + /// + [Reactive] + public string Version { get; set; } } } diff --git a/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.cs b/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.cs index 4b6fbf240..902acac2e 100644 --- a/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.cs +++ b/src/ViewModels/ViewModels.Uwp/Common/SettingViewModel/SettingViewModel.cs @@ -42,6 +42,9 @@ public void InitializeSettings() MTCControlModeInit(); StartupInitAsync(); + var appVersion = Package.Current.Id.Version; + Version = $"{appVersion.Major}.{appVersion.Minor}.{appVersion.Build}.{appVersion.Revision}"; + PropertyChanged += OnPropertyChangedAsync; }