This commit is contained in:
RMBGAME
2021-09-08 03:12:54 +08:00
parent 3606b90915
commit 6dbd643c02
10 changed files with 53 additions and 26 deletions
@@ -10,9 +10,9 @@
<DefineConstants>WINDOWS;WINDOWS_DESKTOP_BRIDGE;$(DefineConstants)</DefineConstants>
<ApplicationIcon>..\ST.Client.Desktop.Avalonia\Application\UI\Assets\Icon.ico</ApplicationIcon>
<ApplicationManifest>..\ST.Client.Desktop.Avalonia.App\Properties\app.manifest</ApplicationManifest>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<PlatformTarget>x64</PlatformTarget>
<PublishSingleFile>false</PublishSingleFile>
<PublishSingleFile>true</PublishSingleFile>
<!--目前裁剪存在问题,禁用-->
<PublishTrimmed>false</PublishTrimmed>
<TrimMode>link</TrimMode>
@@ -6,7 +6,7 @@
xmlns:vm="clr-namespace:System.Application.UI.ViewModels;assembly=System.Application.SteamTools.Client.Desktop"
xmlns:service="clr-namespace:System.Application.Services;assembly=System.Application.SteamTools.Client.Desktop"
xmlns:resx="clr-namespace:System.Application.UI.Resx;assembly=System.Application.SteamTools.Client.Desktop"
xmlns:gif="clr-namespace:AvaloniaGif;assembly=AvaloniaGif"
xmlns:sys="using:System"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="vm:AboutPageViewModel"
x:CompileBindings="True"
@@ -103,6 +103,13 @@
CommandParameter="{x:Static vm:AboutPageViewModel.ChangeLogLink}"
VerticalAlignment="Center"
VerticalContentAlignment="Center"/>
<Button Classes="Hyperlink"
IsVisible="{x:Static sys:DesktopBridge.IsRunningAsUwp}"
Content="{ReflectionBinding Path=Res.About_AppReview,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{Binding OpenBrowserCommand}"
CommandParameter="{x:Static vm:AboutPageViewModel.MicrosoftStoreReviewLink}"
VerticalAlignment="Center"
VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Classes="Header light"
@@ -13,8 +13,6 @@ namespace System.Application.Services.Implementation
{
public abstract partial class DesktopAppUpdateServiceImpl : AppUpdateServiceImpl
{
const string MicrosoftStoreProtocolLink = "ms-windows-store://pdp/?productid=9MTCFHS560NG";
public DesktopAppUpdateServiceImpl(IToast toast, ICloudServiceClient client, IOptions<AppSettings> options) : base(toast, client, options)
{
}
@@ -100,7 +98,7 @@ namespace System.Application.Services.Implementation
{
Process.Start(new ProcessStartInfo
{
FileName = MicrosoftStoreProtocolLink,
FileName = UrlConstants.MicrosoftStoreProtocolLink,
UseShellExecute = true,
});
}
@@ -132,7 +132,7 @@ namespace System.Application.Services.Implementation
{
if (!string.IsNullOrEmpty(SteamProgramPath))
{
Process2.Start(SteamProgramPath, arguments, true);
Process2.Start(SteamProgramPath, arguments);
}
}
+9
View File
@@ -69,6 +69,15 @@ namespace System.Application.UI.Resx {
}
}
/// <summary>
/// 查找类似 打分&amp;评价 的本地化字符串。
/// </summary>
public static string About_AppReview {
get {
return ResourceManager.GetString("About_AppReview", resourceCulture);
}
}
/// <summary>
/// 查找类似 联系我们 的本地化字符串。
/// </summary>
@@ -1598,4 +1598,7 @@
<data name="CommunityFix_ProxyOnlyOnScript" xml:space="preserve">
<value>代理仅启用脚本功能</value>
</data>
<data name="About_AppReview" xml:space="preserve">
<value>打分&amp;评价</value>
</data>
</root>
@@ -29,5 +29,7 @@ namespace System.Application.UI.ViewModels
public static string ChangeLogLink => UrlConstants.OfficialWebsite_Changelog;
public static string LicenseLink => UrlConstants.License_GPLv3;
public static string MicrosoftStoreReviewLink => UrlConstants.MicrosoftStoreReviewLink;
}
}
@@ -45,6 +45,9 @@ namespace System.Application.UI.ViewModels
if (result)
{
AuthService.Current.Authenticators.Clear();
#if !__MOBILE__
MenuItems?.Clear();
#endif
Activation();
}
else
+5
View File
@@ -26,5 +26,10 @@ namespace System.Application
public const string Gitee_Issues = "https://gitee.com/rmbgame/SteamTools/issues";
public const string License_GPLv3 = "https://www.gnu.org/licenses/gpl-3.0.html";
public const string MicrosoftStoreId = "9MTCFHS560NG";
public const string MicrosoftStoreAppWebsite = "https://www.microsoft.com/store/apps/" + MicrosoftStoreId;
public const string MicrosoftStoreProtocolLink = "ms-windows-store://pdp/?productid=" + MicrosoftStoreId;
public const string MicrosoftStoreReviewLink = "ms-windows-store://review/?ProductId=" + MicrosoftStoreId;
}
}
@@ -84,32 +84,32 @@ namespace System.Application.Services.CloudService
/// <param name="url"></param>
public static async void BrowserOpen(string? url)
{
if (IsHttpUrl(url))
//if (IsHttpUrl(url))
//{
if (DeviceInfo.Platform == DevicePlatform.Unknown)
{
if (DeviceInfo.Platform == DevicePlatform.Unknown)
try
{
try
Process.Start(new ProcessStartInfo
{
Process.Start(new ProcessStartInfo
{
FileName = url,
UseShellExecute = true,
});
}
catch (Win32Exception e)
{
#if MVVM_VM
// [Win32Exception: 找不到应用程序] 39次报告
// 疑似缺失没有默认浏览器设置会导致此异常,可能与杀毒软件有关
Toast.Show(e.GetAllMessage());
#endif
}
FileName = url,
UseShellExecute = true,
});
}
else
catch (Win32Exception e)
{
await Browser.OpenAsync(url);
#if MVVM_VM
// [Win32Exception: 找不到应用程序] 39次报告
// 疑似缺失没有默认浏览器设置会导致此异常,可能与杀毒软件有关
Toast.Show(e.GetAllMessage());
#endif
}
}
else
{
await Browser.OpenAsync(url);
}
//}
}
}
}