-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
319 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/DragonFly.Razor/Extensions/NavigationManagerExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) usercode | ||
// https://github.com/usercode/DragonFly | ||
// MIT License | ||
|
||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace DragonFly.Razor.Extensions; | ||
|
||
public static class NavigationManagerExtensions | ||
{ | ||
public static void NavigateToAssets(this NavigationManager manager) | ||
{ | ||
manager.NavigateTo("asset"); | ||
} | ||
|
||
public static void NavigateToAsset(this NavigationManager manager, Asset asset) | ||
{ | ||
manager.NavigateTo($"asset/{asset.Id}"); | ||
} | ||
|
||
public static void NavigateToCreateAsset(this NavigationManager manager, long? folderId = null) | ||
{ | ||
manager.NavigateTo($"asset/create/{folderId}"); | ||
} | ||
|
||
public static void NavigateToContent(this NavigationManager manager, ContentItem content) | ||
{ | ||
manager.NavigateTo($"content/{content.Schema.Name}/create/{content.Id}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.