mirror of https://github.com/abpframework/abp.git
39 changed files with 185 additions and 128 deletions
@ -0,0 +1,21 @@ |
|||
@using global::MudBlazor |
|||
|
|||
<MudButton Color="@Color" |
|||
Variant="@Variant.Filled" |
|||
StartIcon="@IconString" |
|||
Disabled="@Disabled" |
|||
OnClick="@OnClickHandler"> |
|||
@Text |
|||
</MudButton> |
|||
|
|||
@code { |
|||
private string? IconString => Icon?.ToString(); |
|||
|
|||
private async Task OnClickHandler() |
|||
{ |
|||
if (OnClickAsync != null) |
|||
{ |
|||
await OnClickAsync(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Components; |
|||
using MudBlazor; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.PageToolbars; |
|||
|
|||
public partial class MudPageToolbarButton : ComponentBase |
|||
{ |
|||
[Parameter] |
|||
public Color Color { get; set; } = Color.Primary; |
|||
|
|||
[Parameter] |
|||
public object? Icon { get; set; } |
|||
|
|||
[Parameter] |
|||
public string Text { get; set; } = default!; |
|||
|
|||
[Parameter] |
|||
public Func<Task>? OnClickAsync { get; set; } |
|||
|
|||
[Parameter] |
|||
public bool Disabled { get; set; } |
|||
} |
|||
@ -1,14 +1,35 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Components; |
|||
using Volo.Abp.AspNetCore.Components.Web.Security; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.MudBlazorBasicTheme.Themes.Basic; |
|||
|
|||
public partial class NavMenu |
|||
public partial class NavMenu : IDisposable |
|||
{ |
|||
protected ApplicationMenu MenuItems { get; set; } = new(); |
|||
[Inject] |
|||
protected IMenuManager MenuManager { get; set; } |
|||
|
|||
protected override async Task OnInitializedAsync() |
|||
[Inject] |
|||
protected ApplicationConfigurationChangedService ApplicationConfigurationChangedService { get; set; } |
|||
|
|||
protected ApplicationMenu Menu { get; set; } |
|||
|
|||
protected async override Task OnInitializedAsync() |
|||
{ |
|||
Menu = await MenuManager.GetMainMenuAsync(); |
|||
ApplicationConfigurationChangedService.Changed += ApplicationConfigurationChanged; |
|||
} |
|||
|
|||
private async void ApplicationConfigurationChanged() |
|||
{ |
|||
Menu = await MenuManager.GetMainMenuAsync(); |
|||
await InvokeAsync(StateHasChanged); |
|||
} |
|||
|
|||
public void Dispose() |
|||
{ |
|||
MenuItems = await MenuManager.GetMainMenuAsync(); |
|||
ApplicationConfigurationChangedService.Changed -= ApplicationConfigurationChanged; |
|||
} |
|||
} |
|||
|
|||
@ -1,4 +1,9 @@ |
|||
@using Microsoft.AspNetCore.Components.Web |
|||
@using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor |
|||
@using MudBlazor |
|||
@using Volo.Abp.MudBlazorUI |
|||
@using System.Net.Http |
|||
@using Microsoft.AspNetCore.Components.Authorization |
|||
@using Microsoft.AspNetCore.Components.Forms |
|||
@using Microsoft.AspNetCore.Components.Routing |
|||
@using Microsoft.AspNetCore.Components.Web |
|||
@using Microsoft.JSInterop |
|||
@using Volo.Abp.MudBlazorUI; |
|||
@using Volo.Abp.MudBlazorUI.Components; |
|||
Loading…
Reference in new issue