mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Release page - Added release installation
This commit is contained in:
1 parent
9e994840f6
commit
d6f1ba9aad
17 files changed
+219
-150
No files matched your search
@@ -45,6 +45,12 @@ public interface IRouter
|
||||
/// </summary>
|
||||
/// <returns>A task containing a boolean value which indicates whether there was a forward path to go back to.</returns>
|
||||
Task<bool> GoForward();
|
||||
|
||||
/// <summary>
|
||||
/// Asynchronously navigates upwards to the parent route.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> GoUp();
|
||||
|
||||
/// <summary>
|
||||
/// Clears the navigation history.
|
||||
|
||||
@@ -161,6 +161,28 @@ internal class Router : CorePropertyChanged, IRouter, IDisposable
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> GoUp()
|
||||
{
|
||||
string? currentPath = _currentRouteSubject.Value;
|
||||
|
||||
// Keep removing segments until we find a parent route that resolves
|
||||
while (currentPath != null && currentPath.Contains('/'))
|
||||
{
|
||||
string parentPath = currentPath[..currentPath.LastIndexOf('/')];
|
||||
RouteResolution resolution = Resolve(parentPath);
|
||||
if (resolution.Success)
|
||||
{
|
||||
await Navigate(parentPath, new RouterNavigationOptions {AddToHistory = false});
|
||||
return true;
|
||||
}
|
||||
|
||||
currentPath = parentPath;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ClearHistory()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user