mirror of https://github.com/abpframework/abp.git
3 changed files with 42 additions and 2 deletions
@ -1,12 +1,23 @@ |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming; |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming.Theming; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreComponentsWebThemingModule) |
|||
)] |
|||
)] |
|||
public class AbpAspNetCoreComponentsWebBasicThemeModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpThemingOptions>(options => |
|||
{ |
|||
options.Themes.Add<BasicTheme>(); |
|||
|
|||
} |
|||
if (options.DefaultThemeName == null) |
|||
{ |
|||
options.DefaultThemeName = BasicTheme.Name; |
|||
} |
|||
}); |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic; |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming.Layout; |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming.Theming; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme; |
|||
|
|||
[ThemeName(Name)] |
|||
public class BasicTheme : ITheme, ITransientDependency |
|||
{ |
|||
public const string Name = "Basic"; |
|||
|
|||
public virtual Type GetLayout(string name, bool fallbackToDefault = true) |
|||
{ |
|||
switch (name) |
|||
{ |
|||
case StandardLayouts.Application: |
|||
case StandardLayouts.Account: |
|||
case StandardLayouts.Empty: |
|||
return typeof(MainLayout); |
|||
default: |
|||
return fallbackToDefault ? typeof(MainLayout) : typeof(NullLayout); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
@inherits LayoutComponentBase |
|||
|
|||
@Body |
|||
Loading…
Reference in new issue