Files
PlaylistShared/PlaylistShared.Pwa/Components/Global/ContextualBarContent.razor

33 lines
923 B
Plaintext

@implements IDisposable
@inject ContextualActionBarService ContextualActionBarService
@code {
[Parameter] public bool Bottom { get; set; } = false;
[Parameter] public RenderFragment? ChildContent { get; set; }
protected override void OnParametersSet()
{
bool isChanged = false;
if (ContextualActionBarService.Content != ChildContent)
{
ContextualActionBarService.Content = ChildContent;
isChanged = true;
}
if (ContextualActionBarService.Bottom != Bottom)
{
ContextualActionBarService.Bottom = Bottom;
isChanged = true;
}
if (isChanged) ContextualActionBarService.ChangeParameters();
}
public void Dispose()
{
ContextualActionBarService.Content = null;
ContextualActionBarService.Bottom = null;
ContextualActionBarService.ChangeParameters();
}
}