мелкие улучшенния
This commit is contained in:
30
PlaylistShared.Pwa/Components/Global/ContextualBarContent.cs
Normal file
30
PlaylistShared.Pwa/Components/Global/ContextualBarContent.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user