30 lines
943 B
C#
30 lines
943 B
C#
using Microsoft.AspNetCore.Components;
|
|
using PlaylistShared.Pwa.Services;
|
|
|
|
namespace PlaylistShared.Pwa.Components.Global;
|
|
|
|
public class ContextualBarContent : ComponentBase, IDisposable
|
|
{
|
|
[Inject]
|
|
public ContextualActionBarService ContextualActionBarService { get; set; } = default!;
|
|
|
|
[Parameter]
|
|
public ContextualActionBarPosition Position { get; set; } = ContextualActionBarPosition.Default;
|
|
|
|
[Parameter]
|
|
public RenderFragment? ChildContent { get; set; }
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
ContextualActionBarService.Content = ChildContent;
|
|
ContextualActionBarService.Position = Position;
|
|
ContextualActionBarService.ChangeParameters();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
ContextualActionBarService.Content = null;
|
|
ContextualActionBarService.Position = ContextualActionBarPosition.Default;
|
|
ContextualActionBarService.ChangeParameters();
|
|
}
|
|
} |