You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1012 B
28 lines
1012 B
using System.Threading.Tasks;
|
|
using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Toolbars;
|
|
using Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Themes.AntDesignTheme;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme;
|
|
|
|
public class AntDesignThemeToolbarContributor: IToolbarContributor
|
|
{
|
|
public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
|
|
{
|
|
if (context.Toolbar.Name == StandardToolbars.Main)
|
|
{
|
|
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitch)));
|
|
|
|
var authenticationStateProvider = context.ServiceProvider
|
|
.GetRequiredService<AuthenticationStateProvider>();
|
|
|
|
if (authenticationStateProvider != null)
|
|
{
|
|
context.Toolbar.Items.Add(new ToolbarItem(typeof(LoginDisplay)));
|
|
}
|
|
}
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|