具有自己的导航提供程序的模块化系统

时间:2020-03-05 16:42:52

标签: asp.net-core model-view-controller aspnetboilerplate abp

我正在使用ABP Zero创建一个新应用程序,并且走了使用模块化方法将其他Web项目插入主应用程序的路线。

下面的代码可以很好地添加到服务,视图和控制器中。

[DependsOn(
    typeof(DocumentsApplicationModule))]
public class DocumentsWebModule : AbpModule
{

    public override void PreInitialize()
    {
        //add in navigation
        Configuration.Navigation.Providers.Add<NavigationProvider>();

        //add in js for module views
        Configuration.EmbeddedResources.Sources.Add(
            new EmbeddedResourceSet(
                "/ModuleResources/",
                Assembly.GetExecutingAssembly(),
                "Documents.Web.ModuleResources"
            )
        );

        //add the dynamic api for the module
        Configuration.Modules.AbpAspNetCore()
            .CreateControllersForAppServices(
            typeof(DocumentsApplicationModule).GetAssembly(),
            moduleName: "doc",
            useConventionalHttpVerbs: true
        );
    }

    public override void Initialize()
    {
        IocManager.RegisterAssemblyByConvention(typeof(DocumentsWebModule).GetAssembly());
    }
}

但是,我希望每个模块都有其自己的菜单,并在浏览时替换当前的导航提供程序。我似乎找不到任何有关如何实现此目标的文档。

Main Menu

因此,如图所示,文档项已添加到主导航提供程序中,当浏览到该菜单项时,我希望整个菜单都更改。

0 个答案:

没有答案