Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
添加关于应用的说明 (#57)
Browse files Browse the repository at this point in the history
* 添加关于应用的说明

* Update doc.md

* Create LICENSE
  • Loading branch information
Richasy committed Sep 17, 2021
1 parent 848a121 commit 4451109
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/doc.md
Expand Up @@ -7,6 +7,8 @@ assignees: Richasy

---

<!-- 🚨 请不要跳过或删除下面的信息,它们都是评估与测试所需的信息,完整填写有助于更快通过评审 🚨 -->

## 关联文档

<!-- 请取消下方的注释,并使用这样的方式插入与该问题有关的文档链接,如果你的问题与某个具体文档无关,请忽略 -->
Expand Down
21 changes: 21 additions & 0 deletions 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.
18 changes: 18 additions & 0 deletions src/App/Pages/SettingPage.xaml
Expand Up @@ -10,6 +10,13 @@
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">

<Page.Resources>
<Style x:Key="TipTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{ThemeResource TextFillColorDisabledBrush}" />
<Setter Property="FontSize" Value="12" />
</Style>
</Page.Resources>

<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LayoutGroup">
Expand Down Expand Up @@ -55,6 +62,17 @@
<controls:PlayerModeSettingSection />
<controls:PlayerControlSettingSection />
<controls:MTCSettingSection />
<StackPanel
Margin="0,12,0,0"
HorizontalAlignment="Left"
Spacing="4">
<TextBlock Style="{StaticResource TipTextStyle}" Text="{loc:LocaleLocator Name=AboutThisApp}" />
<TextBlock Style="{StaticResource TipTextStyle}">
<Run Text="{loc:LocaleLocator Name=AppName}" />
<Run Text="{x:Bind ViewModel.Version}" />
</TextBlock>
<TextBlock Style="{StaticResource TipTextStyle}" Text="{loc:LocaleLocator Name=License}" />
</StackPanel>
</StackPanel>
</muxc:ScrollView>
</Grid>
Expand Down
8 changes: 7 additions & 1 deletion src/App/Pages/SettingPage.xaml.cs
Expand Up @@ -17,12 +17,18 @@ public sealed partial class SettingPage : Page
public SettingPage()
{
this.InitializeComponent();
ViewModel = SettingViewModel.Instance;
}

/// <summary>
/// 视图模型.
/// </summary>
public SettingViewModel ViewModel { get; private set; }

/// <inheritdoc/>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
SettingViewModel.Instance.InitializeSettings();
ViewModel.InitializeSettings();
}
}
}
6 changes: 6 additions & 0 deletions src/App/Resources/Strings/zh-CN/Resources.resw
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AboutThisApp" xml:space="preserve">
<value>关于此应用</value>
</data>
<data name="AddReplyFailed" xml:space="preserve">
<value>添加评论失败,请稍后再试</value>
</data>
Expand Down Expand Up @@ -476,6 +479,9 @@
<data name="LastestReply" xml:space="preserve">
<value>最新评论</value>
</data>
<data name="License" xml:space="preserve">
<value>©2021 Richasy. MIT 许可证</value>
</data>
<data name="Light" xml:space="preserve">
<value>浅色</value>
</data>
Expand Down
2 changes: 2 additions & 0 deletions src/Models/Models.Enums/App/LanguageNames.cs
Expand Up @@ -328,6 +328,8 @@ public enum LanguageNames
NoRoomDescription,
LogEmptied,
FailedToClearLog,
AboutThisApp,
License,
#pragma warning restore SA1602 // Enumeration items should be documented
}
}
Expand Up @@ -105,5 +105,11 @@ public partial class SettingViewModel
/// </summary>
[Reactive]
public double SingleFastForwardAndRewindSpan { get; set; }

/// <summary>
/// 应用版本.
/// </summary>
[Reactive]
public string Version { get; set; }
}
}
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4451109

Please sign in to comment.