mirror of https://github.com/abpframework/abp.git
8 changed files with 122 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Blazor.Menus |
|||
{ |
|||
public class MyProjectNameMenuContributor : IMenuContributor |
|||
{ |
|||
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
|||
{ |
|||
if (context.Menu.Name == StandardMenus.Main) |
|||
{ |
|||
await ConfigureMainMenu(context); |
|||
} |
|||
} |
|||
|
|||
private Task ConfigureMainMenu(MenuConfigurationContext context) |
|||
{ |
|||
//Add main menu items.
|
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
namespace MyCompanyName.MyProjectName.Blazor.Menus |
|||
{ |
|||
public class MyProjectNameMenus |
|||
{ |
|||
private const string Prefix = "MyProjectName"; |
|||
|
|||
//Add your menu items here...
|
|||
//public const string Home = Prefix + ".MyNewMenuItem";
|
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.1</TargetFramework> |
|||
<RazorLangVersion>3.0</RazorLangVersion> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,14 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Blazor |
|||
{ |
|||
public class MyProjectNameBlazorAutoMapperProfile : Profile |
|||
{ |
|||
public MyProjectNameBlazorAutoMapperProfile() |
|||
{ |
|||
/* You can configure your AutoMapper mapping configuration here. |
|||
* Alternatively, you can split your mapping configurations |
|||
* into multiple profile classes for a better organization. */ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using MyCompanyName.MyProjectName.Blazor.Menus; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing; |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Blazor |
|||
{ |
|||
[DependsOn( |
|||
typeof(MyProjectNameHttpApiClientModule), |
|||
typeof(AbpAutoMapperModule) |
|||
)] |
|||
public class MyProjectNameBlazorModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAutoMapperObjectMapper<MyProjectNameBlazorModule>(); |
|||
|
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddProfile<MyProjectNameBlazorAutoMapperProfile>(validate: true); |
|||
}); |
|||
|
|||
Configure<AbpNavigationOptions>(options => |
|||
{ |
|||
options.MenuContributors.Add(new MyProjectNameMenuContributor()); |
|||
}); |
|||
|
|||
Configure<AbpRouterOptions>(options => |
|||
{ |
|||
options.AdditionalAssemblies.Add(typeof(MyProjectNameBlazorModule).Assembly); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
@page "/MyProjectName" |
|||
@using Microsoft.Extensions.Localization |
|||
@using MyCompanyName.MyProjectName.Localization |
|||
@inject IStringLocalizer<MyProjectNameResource> L |
|||
@{ |
|||
} |
|||
<h1>MyProjectName</h1> |
|||
<p>@L["SamplePageMessage"]</p> |
|||
@ -0,0 +1,5 @@ |
|||
@using Microsoft.AspNetCore.Components.Web |
|||
@using Volo.Abp.AspNetCore.Components.WebAssembly |
|||
@using Volo.Abp.BlazoriseUI |
|||
@using Blazorise |
|||
@using Blazorise.DataGrid |
|||
Loading…
Reference in new issue