mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix achievement check status save
This commit is contained in:
@@ -21,7 +21,7 @@ internal sealed partial class InvokeCommandOnLoadedBehavior : BehaviorBase<UIEle
|
|||||||
base.OnAttached();
|
base.OnAttached();
|
||||||
|
|
||||||
// FrameworkElement in a ItemsRepeater gets attached twice
|
// FrameworkElement in a ItemsRepeater gets attached twice
|
||||||
if (!executed && AssociatedObject is FrameworkElement { IsLoaded: true })
|
if (AssociatedObject is FrameworkElement { IsLoaded: true })
|
||||||
{
|
{
|
||||||
TryExecuteCommand();
|
TryExecuteCommand();
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,11 @@ internal sealed partial class InvokeCommandOnLoadedBehavior : BehaviorBase<UIEle
|
|||||||
|
|
||||||
private void TryExecuteCommand()
|
private void TryExecuteCommand()
|
||||||
{
|
{
|
||||||
|
if (executed)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Command is not null && Command.CanExecute(CommandParameter))
|
if (Command is not null && Command.CanExecute(CommandParameter))
|
||||||
{
|
{
|
||||||
Command.Execute(CommandParameter);
|
Command.Execute(CommandParameter);
|
||||||
|
|||||||
@@ -270,10 +270,18 @@ internal sealed partial class Activation : IActivation
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await serviceProvider
|
if (currentWindowReference.Window is MainWindow)
|
||||||
.GetRequiredService<INavigationService>()
|
{
|
||||||
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
|
await serviceProvider
|
||||||
.ConfigureAwait(false);
|
.GetRequiredService<INavigationService>()
|
||||||
|
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
|
||||||
|
.ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We have a non-Main Window, just exit current process anyway
|
||||||
|
Process.GetCurrentProcess().Kill();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ internal sealed class AchievementView : ObservableObject, IEntityWithMetadata<Mo
|
|||||||
{
|
{
|
||||||
(Entity.Status, Entity.Time) = value
|
(Entity.Status, Entity.Time) = value
|
||||||
? (AchievementStatus.STATUS_REWARD_TAKEN, DateTimeOffset.Now)
|
? (AchievementStatus.STATUS_REWARD_TAKEN, DateTimeOffset.Now)
|
||||||
: (AchievementStatus.STATUS_FINISHED, default);
|
: (AchievementStatus.STATUS_INVALID, default);
|
||||||
|
|
||||||
OnPropertyChanged(nameof(Time));
|
OnPropertyChanged(nameof(Time));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user