mirror of https://github.com/abpframework/abp.git
committed by
GitHub
3 changed files with 77 additions and 26 deletions
@ -0,0 +1,26 @@ |
|||||
|
using System; |
||||
|
using JetBrains.Annotations; |
||||
|
using Volo.Abp.UI.Navigation; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Navigation; |
||||
|
|
||||
|
public static class BasicThemeNavigationExtensions |
||||
|
{ |
||||
|
public const string CustomDataComponentKey = "BasicTheme.CustomComponent"; |
||||
|
|
||||
|
public static ApplicationMenuItem UseComponent(this ApplicationMenuItem applicationMenuItem, Type componentType) |
||||
|
{ |
||||
|
return applicationMenuItem.WithCustomData(CustomDataComponentKey, componentType); |
||||
|
} |
||||
|
|
||||
|
[CanBeNull] |
||||
|
public static Type GetComponentTypeOrDefault(this ApplicationMenuItem applicationMenuItem) |
||||
|
{ |
||||
|
if (applicationMenuItem.CustomData.TryGetValue(CustomDataComponentKey, out object componentType)) |
||||
|
{ |
||||
|
return componentType as Type; |
||||
|
} |
||||
|
|
||||
|
return default; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue