Skip to content

Commit

Permalink
Merge pull request LykosAI#606 from ionite34/go-back-after-install
Browse files Browse the repository at this point in the history
go back after install
  • Loading branch information
mohnjiles authored Apr 14, 2024
2 parents c285a0c + fa458e2 commit d73ca68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions StabilityMatrix.Avalonia/Services/INavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ void NavigateTo(
bool GoBack();

bool CanGoBack { get; }
object? CurrentPageDataContext { get; }
}
3 changes: 3 additions & 0 deletions StabilityMatrix.Avalonia/Services/NavigationService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Linq;
using Avalonia.Controls;
using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Media.Animation;
using FluentAvalonia.UI.Navigation;
Expand Down Expand Up @@ -190,4 +191,6 @@ public bool GoBack()
}

public bool CanGoBack => _frame?.CanGoBack ?? false;

public object? CurrentPageDataContext => (_frame?.Content as Control)?.DataContext;
}
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ private async Task Install()

if (!runner.Failed)
{
if (ReferenceEquals(this, packageNavigationService.CurrentPageDataContext))
{
packageNavigationService.GoBack();
packageNavigationService.GoBack();
await Task.Delay(100);
}

EventManager.Instance.OnInstalledPackagesChanged();
}
}
Expand Down

0 comments on commit d73ca68

Please sign in to comment.