更新日志

This commit is contained in:
rmbgame
2021-05-13 03:21:00 +08:00
parent 45c0987a72
commit 0fa8efbfff
7 changed files with 125 additions and 18 deletions
@@ -0,0 +1,12 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:System.Application.UI.Views.Controls;assembly=System.Application.SteamTools.Client.Desktop.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="System.Application.UI.Views.Pages.About_ChangeLog">
<Panel>
<controls:WebView3 x:Name="webViewQA" Background="Transparent" />
<controls:ProgressRing x:Name="webViewQALoading" IsIndeterminate="True" HorizontalAlignment="Stretch" Height="100" Width="100" />
</Panel>
</UserControl>
@@ -0,0 +1,78 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.LogicalTree;
using Avalonia.Markup.Xaml;
using CefNet;
using System.Application.UI.Resx;
using System.Application.UI.Views.Controls;
namespace System.Application.UI.Views.Pages
{
public class About_ChangeLog : UserControl, IDisposable
{
readonly WebView3 webViewQA;
readonly ProgressRing webViewQALoading;
bool disposedValue;
public About_ChangeLog()
{
InitializeComponent();
webViewQALoading = this.FindControl<ProgressRing>(nameof(webViewQALoading));
webViewQA = this.FindControl<WebView3>(nameof(webViewQA));
webViewQA.Opacity = 0;
webViewQA.LoadingStateChange += WebView_LoadingStateChange;
webViewQA.InitialUrl = string.Format(
"https://steampp.net/changelogbox?theme={0}&language={1}",
CefNetApp.GetTheme(),
R.Language);
}
private void WebView_LoadingStateChange(object? sender, LoadingStateChangeEventArgs e)
{
if (!e.Busy)
{
if (webViewQA.Opacity != 1) webViewQA.Opacity = 1;
if (webViewQALoading.IsVisible) webViewQALoading.IsVisible = false;
}
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
{
base.OnDetachedFromLogicalTree(e);
Dispose();
}
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
// TODO: 释放托管状态(托管对象)
if (webViewQA != null)
{
webViewQA.LoadingStateChange -= WebView_LoadingStateChange;
((IDisposable)webViewQA).Dispose();
}
}
// TODO: 释放未托管的资源(未托管的对象)并替代终结器
// TODO: 将大型字段设置为 null
disposedValue = true;
}
}
public void Dispose()
{
// 不要更改此代码。请将清理代码放入“Dispose(bool disposing)”方法中
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
@@ -8,21 +8,24 @@
mc:Ignorable="d"
d:DesignWidth="800" d:DesignHeight="450"
x:Class="System.Application.UI.Views.Pages.AboutPage">
<TabControl Classes="flat">
<TabItem Header="{ReflectionBinding Path=Res.About_ThisSoft,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_SoftwarePage>
<pages:About_SoftwarePage.DataContext>
<vm:AboutPageViewModel/>
</pages:About_SoftwarePage.DataContext>
</pages:About_SoftwarePage>
</TabItem>
<TabItem Header="{ReflectionBinding Path=Res.About_FAQ,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_FAQPage />
</TabItem>
<TabItem Header="{ReflectionBinding Path=Res.About_OpenSource,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_OpenSourcePage />
</TabItem>
<!--<TabItem Header="{ReflectionBinding Path=Res.About_Contactus,Mode=OneWay,Source={x:Static resx:R.Current}}">
<TabControl Classes="flat">
<TabItem Header="{ReflectionBinding Path=Res.About_ThisSoft,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_SoftwarePage>
<pages:About_SoftwarePage.DataContext>
<vm:AboutPageViewModel/>
</pages:About_SoftwarePage.DataContext>
</pages:About_SoftwarePage>
</TabItem>
<TabItem Header="{ReflectionBinding Path=Res.About_UpdateLog,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_ChangeLog />
</TabItem>
<TabItem Header="{ReflectionBinding Path=Res.About_FAQ,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_FAQPage />
</TabItem>
<TabItem Header="{ReflectionBinding Path=Res.About_OpenSource,Mode=OneWay,Source={x:Static resx:R.Current}}">
<pages:About_OpenSourcePage />
</TabItem>
<!--<TabItem Header="{ReflectionBinding Path=Res.About_Contactus,Mode=OneWay,Source={x:Static resx:R.Current}}">
</TabItem>-->
</TabControl>
</UserControl>
</TabControl>
</UserControl>
@@ -79,7 +79,6 @@
</TextBlock>
<ListBox Items="{Binding WindowList,Mode=OneWay}"
Background="Transparent"
Height="200" Margin="0,5"
SelectedItem="{Binding SelectWindow}">
<ListBox.ItemTemplate>
@@ -58,6 +58,9 @@
</ItemGroup>
<ItemGroup>
<Compile Update="Application\UI\Views\Pages\About\About_Changelog.axaml.cs">
<DependentUpon>About_ChangeLog.axaml</DependentUpon>
</Compile>
<Compile Update="Application\UI\Views\Pages\GameRelatedPage.axaml.cs">
<DependentUpon>GameRelatedPage.axaml</DependentUpon>
</Compile>
+9
View File
@@ -132,6 +132,15 @@ namespace System.Application.UI.Resx {
}
}
/// <summary>
/// 查找类似 更新日志 的本地化字符串。
/// </summary>
public static string About_UpdateLog {
get {
return ResourceManager.GetString("About_UpdateLog", resourceCulture);
}
}
/// <summary>
/// 查找类似 描述 的本地化字符串。
/// </summary>
@@ -141,6 +141,9 @@
<data name="About_UpdateHistory" xml:space="preserve">
<value>更新记录</value>
</data>
<data name="About_UpdateLog" xml:space="preserve">
<value>更新日志</value>
</data>
<data name="AchievementManage" xml:space="preserve">
<value>成就管理</value>
</data>